Jump to content

[SOLVED] please help with mysql select statement with inner join and variable


blue-genie

Recommended Posts

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";

                     

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.

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.