Advertisement
athacks

Untitled

May 12th, 2015
533
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.97 KB | None | 0 0
  1. <?php
  2. $host = "10";
  3. $user = "Dapp";
  4. $pw = "2@";
  5. $db = "Dpp";
  6.  
  7. $con = mysql_connect($host,$user,$pw) or die(mysql_error());
  8. mysql_select_db($db) or die(mysql_error());
  9. mysql_query("SET CHARACTER SET utf8");
  10. mysql_query("SET NAMES 'utf8'");
  11.  
  12. $Action = $_GET["Action"];
  13. $mid = $_GET["MID"];
  14.  
  15. switch ($Action)
  16.  
  17. {
  18.    
  19.     Case "CheckMID":
  20.        $result = mysql_query("SELECT * FROM Merchants WHERE MID = '$mid';");
  21.        if (mysql_num_rows($result) == 0) {
  22.            print json_encode("No");
  23.            
  24.         } else {
  25.            print json_encode ("Yes");
  26.            print json_encode ($result);
  27.         }
  28.     break;
  29.    
  30.     Case "GetMerchantName":
  31.         while($row = mysql_fetch_array($query)){
  32.         echo "\r\n".$row['MERNAME'];
  33.         }
  34.        $text = mysql_query("SELECT MID, MERNAME FROM Merchants WHERE MID LIKE '$mid';") or die(mysql_error());
  35.        print json_encode ($text);
  36.        
  37.     break;
  38.  
  39.     Case "Mail":
  40.        
  41.      break;
  42. }
  43.  
  44. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement