theagonizer Posted November 10, 2007 Share Posted November 10, 2007 this works fine $result = mysql_query("SELECT ID, title, src, description FROM images WHERE ID = 0"); $row = mysql_fetch_array($result); however this... $result = mysql_query("SELECT ID, title, src, description, order FROM images WHERE ID = 0"); $row = mysql_fetch_array($result); .. did not work when I added the order field to the table in phpmyadmin. Then it returns "Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource. even though there is an order field." I have noticed that if I turn the "order" field from an int to a type varchar it then works. any ideas? Quote Link to comment Share on other sites More sharing options...
rajivgonsalves Posted November 10, 2007 Share Posted November 10, 2007 try SELECT `ID`, `title`, `src`, `description`, `order` FROM images WHERE ID = 0 Quote Link to comment Share on other sites More sharing options...
theagonizer Posted November 10, 2007 Author Share Posted November 10, 2007 it worked! Thank you. anybody know why this code has worked for me for years and now all of a sudden I need the little quotes. Am I using antequated coding? Quote Link to comment Share on other sites More sharing options...
PHP_PhREEEk Posted November 10, 2007 Share Posted November 10, 2007 the word order is a MySQL reserved word (used for sorting). if you escape it with backticks, `order`, MySQL treats it as a field name PhREEEk Quote Link to comment 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.