Jump to content
MakeWebGames

Recommended Posts

Posted

don't know what i'm doing wrong here.

game_id = 2

all my fields are right in the query

anybody see a problem?

$game_id = mysql_real_escape_string($_GET['id']);

//retreive game data
$result = mysql_query("SELECT game_data.name, game_data.platform_id, game_consoles.console FROM game_data, game_consoles WHERE game_consoles.id='game_data.platform_id' AND game_data.id='$game_id'") or die(mysql_error());
$game_data = mysql_fetch_assoc($result);

var_dump($game_data);
Posted

you have

[mysql]game_consoles.id='game_data.platform_id'[/mysql]

This means that game_consoles.id will check for a string which is game_data.platform_id.

I doubt this is what you want, so try to remove the quotes around game_data.platform_id and it should work.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...