Mysql error _ PHP Tutorial

Source: Internet
Author: User
Mysql error. Mysql Error SQL statement $ insertinsertintoforumsetname $ name, description $ description, order $ order, open $ open; Error report: YouhaveanerrorinyourSQLsyntax; mysql Error

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

Error 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 a database, only the first two fields are inserted.


Best answer [url = http://www.111cn.cn/bbs/space.php? Username = glory together] Glory marked together by links [/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' = 'admin', 'description' = 'Satan's master ', 'order' = '1', 'open' = '1 ';
Look

Order is the keyword
Attachment: you cannot download or view attachments in your user group.


D8888D reply content -------------------------------------------------------
Insert into forum set 'name' = 'admin', 'description' = 'Satan's master', 'order' = '1', 'open' = '1 ';
Look

Order is the keyword

D8888D reply content -------------------------------------------------------
Check the $ insert output.

D8888D reply content -------------------------------------------------------
Insert into forum set name = 'admin', description = 'Satan's master', order = '1', open = '1'

D8888D reply content -------------------------------------------------------
Order = '1', open = '1' error is here

D8888D reply content -------------------------------------------------------
It is also a syntax error: insert into table_name

VALUES (value1, value2, value3 ,...)
Insert into table_name (column1, column2, column3 ,...)

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


D8888D reply content -------------------------------------------------------
Understand

D8888D reply content -------------------------------------------------------
What's the problem? let's talk about it...

D8888D reply content -------------------------------------------------------
Order is the keyword

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


Explain SQL statement $ insert = "insert into forum set name = '$ name', description =' $ description', order = '$ order', open =' $ open '"; error Report: You have an error in your SQL syntax ;...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.