Jump to content

[SOLVED] Odd Query Error


Steve Angelis

Recommended Posts

$ribbon_select = 'select * from phpbb_medal_user where user_id=$user_id_user';
$ribbon_result = mysql_query($ribbon_select) or die("$ribbon_select does not make any sence;<br>" . mysql_error());
$x = 0;
while ($list = mysql_fetch_assoc($ribbon_result)) {
   $x++;
echo $list['medal_id'];
echo (($x % 9) == 0) ? "<br />" : " ";
}

 

That is my code.  $user_id_user is a field that gets an id number of a user to match up all the data in a db to a specific user.  The code works perfectly when you remove this part:

 

where user_id=$user_id_user

 

Once you insert it you get this error:

 

select * from phpbb_medal_user where user_id=$user_id_user does not make any sence;

Unknown column '$user_id_user' in 'where clause'

 

Any ideas as to where I went wrong>

Link to comment
https://forums.phpfreaks.com/topic/110450-solved-odd-query-error/
Share on other sites

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.