blue-genie Posted September 15, 2009 Share Posted September 15, 2009 I'm trying to get some data from 2 tables, the gameID will be sent to the php from flash. $gameID=$_GET['gameID']; $sql = "SELECT * FROM gameinstance a inner join games b on a.gameID = b.'$gameID' order by gameDateTime LIMIT 0, 1"; Link to comment https://forums.phpfreaks.com/topic/174288-solved-please-help-with-mysql-select-statement-with-inner-join-and-variable/ Share on other sites More sharing options...
blue-genie Posted September 15, 2009 Author Share Posted September 15, 2009 ok i've changed it to this <?php session_start(); include 'config.php'; include 'opendb.php'; $gameID=$_GET['gameID']; function getGameConfig($arg) { $sql = "SELECT * FROM gameinstance a inner join games b on a.gameID = b.'".$gameID."' order by gameDateTime LIMIT 0, 1"; $result = mysql_query($sql); echo '<?xml version="1.0"?>'; echo '<dataxml>'; if ($result){ echo "<gameID>".$result['gameID']."</gameID>"; echo "<instanceID>".$result['gameInstance_No']."</instanceID>"; echo "<gameRNG>".$result['gameRNGResult']."</gameRNG>"; echo "<numTries>".$result['numTries']."</numTries>"; echo "<gameOdds>".$result['gameOdds']."</gameOdds>"; echo "<canSMS>".$result['canSMS']."</canSMS>"; echo "<winType>".$result['winType']."</winType>"; }else{ echo '<error>no results</error>'; } echo '</dataxml>'; } getGameConfig($gameID); ?> but it's not returning any results, and there definately is something so i'm guessing it's the b. part before the variable? please advise if you can. Link to comment https://forums.phpfreaks.com/topic/174288-solved-please-help-with-mysql-select-statement-with-inner-join-and-variable/#findComment-918759 Share on other sites More sharing options...
blue-genie Posted September 15, 2009 Author Share Posted September 15, 2009 ok sorry as i was typing out my second comment i realised my idiot move, i won't parse the b. in the variable Link to comment https://forums.phpfreaks.com/topic/174288-solved-please-help-with-mysql-select-statement-with-inner-join-and-variable/#findComment-918760 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.