Home  >  Article  >  Backend Development  >  mysql error_PHP tutorial

mysql error_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 10:51:47830browse




mysql error

sql statement
$insert="insert into forum set name='$name',description='$description',order='$order',open='$open'";

Bug Report
Error: 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='1',open='0'' at line 1

When inserting into the database, there is no problem with inserting only the first two fields


Best answer [url=http://www.111cn.cn/bbs/space.php?username=Glory together]Link tag Glory together[/url]
[url=http://www.111cn.cn/bbs/space.php?uid=129958]Link tag[img]http://www.111cn.cn/server/avatar.php?uid=129958&size=small[ /img][/url]insert into forum set `name`='administrator',`description`='Satan Master's',`order`='1',`open`='1';
Take a look

order is the keyword
Attachment: Your user group cannot download or view attachments


D8888D reply content------------------------------------------------- ----------
insert into forum set `name`='administrator',`description`='Satan Master's',`order`='1',`open`='1';
Take a look

order is the keyword

D8888D reply content------------------------------------------------- ----------
Please output $insert and check it

D8888D reply content------------------------------------------------- ----------
insert into forum set name='administrator',description='Satan Master's',order='1',open='1'

D8888D reply content------------------------------------------------- ----------
order='1',open='1'The error lies here

D8888D reply content------------------------------------------------- ----------
It’s really a syntax error: INSERT INTO table_name

VALUES (value1, value2, value3,...)
Copy the code INSERT INTO table_name (column1, column2, column3,...)

VALUES (value1, value2, value3,...)
Copy code

D8888D reply content------------------------------------------------- ----------
Got it

D8888D reply content------------------------------------------------- ----------
What's the problem? Tell me...

D8888D reply content------------------------------------------------- ----------
order is the keyword

D8888D reply content------------------------------------------------- ----------
[img]http://www.111cn.cn/bbs/images/smilies/default/dizzy.gif[/img]


www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/632557.htmlTechArticlemysql error sql statement $insert="insert into forum set name='$name',description='$description ',order='$order',open='$open'"; Error reportError: You have an error in your SQL syntax;...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn