Jump to content

stuck with very strange MYSQL select error


ooda55

Recommended Posts

When i try to run the following code i get this error:

Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\wamp\www\farm\kindle1.php on line 36

 $getuserid = "SELECT STKFF, BUYFF, BUYMF, COMMENT, ORDER FROM products WHERE PRODUCT = '$item'";
$userid22 = mysql_query($getuserid);
while($webrow = mysql_fetch_array($userid22)) { 
  		 	$STKFF = $webrow['STKFF'];
  		 	$BUYFF = $webrow['BUYFF'];
		$BUYMF = $webrow['BUYMF'];
		$COMMENT = $webrow['COMMENT'];
		$order = $webrow['ORDER'];
		}

The odd thing is it works fine when i dont ask it to select "ORDER"

here is a printscreen of the DB in phpmyadmin (attatched)

ncgwi1.jpg

2m4zork.jpg

If anyone knows what up please coment!

All help is greatley appreciated!!!!

 

 

[attachment deleted by admin]

ORDER is a reserved mysql keyword (as in ORDER BY...). If you were using some error checking in your code, you would be getting a sql error at that point in the query.

 

Either rename your ORDER column to something else or you must enclose it in back-ticks `` every time you use it in a query.

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.