Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- include ("/home/xtweb/public_html/EVE/inc/initdatabase.php");
- include("json.php");
- // station
- if ($_REQUEST['locationtype']=="station")
- {
- $sql = "SELECT systemitems.itemID, systemitems.itemName
- FROM evedb.systemitems
- INNER JOIN evedb.types
- ON types.typeID=systemitems.typeID
- AND types.groupID=15
- WHERE itemName LIKE '%".mysql_real_escape_string($_REQUEST['findlocation'])."%'
- LIMIT 10";
- echo json_request($sql);
- }
- function json_request($sql)
- {
- $res = mysql_query($sql) or die ("json_request:" . $sql . '<br/>' . mysql_error());
- $json_array = new Array();
- while($json_array[] = mysql_fetch_assoc($res)) {}
- return json_encode($json_array);
- }
- ?>
Add Comment
Please, Sign In to add comment