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]

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

  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...

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.