pouncer Posted March 11, 2007 Share Posted March 11, 2007 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order, forum_name, description) VALUES('1', 'ghgfj', 'hjhj') $tot = mysql_num_rows(mysql_query("SELECT * FROM forum_name")); $tot = $tot + 1; $sql = mysql_query("INSERT INTO forum_name (order, forum_name, description) VALUES('$tot', '$Forum_Name', '$Forum_Desc')") or die (mysql_error()); any one see why the error? Link to comment https://forums.phpfreaks.com/topic/42174-php-error/ Share on other sites More sharing options...
AndyB Posted March 11, 2007 Share Posted March 11, 2007 order is a reserved word and should never be used as a field name. While you can avoid the problem by surrounding reserved words with `backticks`, it's far better practice not to use reserved words as field names. Link to comment https://forums.phpfreaks.com/topic/42174-php-error/#findComment-204589 Share on other sites More sharing options...
pouncer Posted March 11, 2007 Author Share Posted March 11, 2007 ahhh i see! thanks Link to comment https://forums.phpfreaks.com/topic/42174-php-error/#findComment-204596 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.