Jump to content

php error


pouncer

Recommended Posts

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
Share on other sites

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