Guest User

Untitled

a guest
Jul 20th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. <?php
  2. session_start();
  3. include ("/home/xtweb/public_html/EVE/inc/initdatabase.php");
  4. include("json.php");
  5.  
  6. // station
  7. if ($_REQUEST['locationtype']=="station")
  8. {
  9. $sql = "SELECT systemitems.itemID, systemitems.itemName
  10. FROM evedb.systemitems
  11. INNER JOIN evedb.types
  12. ON types.typeID=systemitems.typeID
  13. AND types.groupID=15
  14. WHERE itemName LIKE '%".mysql_real_escape_string($_REQUEST['findlocation'])."%'
  15. LIMIT 10";
  16.  
  17. echo json_request($sql);
  18. }
  19.  
  20.  
  21. function json_request($sql)
  22. {
  23. $res = mysql_query($sql) or die ("json_request:" . $sql . '<br/>' . mysql_error());
  24.  
  25. $json_array = new Array();
  26. while($json_array[] = mysql_fetch_assoc($res)) {}
  27.  
  28. return json_encode($json_array);
  29. }
  30.  
  31.  
  32.  
  33. ?>
Add Comment
Please, Sign In to add comment