ooda55 Posted November 25, 2010 Share Posted November 25, 2010 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) If anyone knows what up please coment! All help is greatley appreciated!!!! [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/219834-stuck-with-very-strange-mysql-select-error/ Share on other sites More sharing options...
PFMaBiSmAd Posted November 25, 2010 Share Posted November 25, 2010 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. Quote Link to comment https://forums.phpfreaks.com/topic/219834-stuck-with-very-strange-mysql-select-error/#findComment-1139581 Share on other sites More sharing options...
ooda55 Posted November 25, 2010 Author Share Posted November 25, 2010 Cheers thats working perfectly now, i thought it was going to be somthing insanley complicated, completley forgot to check if it was a reserved keyword Quote Link to comment https://forums.phpfreaks.com/topic/219834-stuck-with-very-strange-mysql-select-error/#findComment-1139584 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.