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? Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
pouncer Posted March 11, 2007 Author Share Posted March 11, 2007 ahhh i see! thanks 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.