A table was created:
1+-------------+--------------+------+-----+---------+----------------+2| Field | Type | Null | Key | Default | Extra |3+-------------+--------------+------+-----+---------+----------------+4| ID |int( One) | NO | PRI | NULL | auto_increment |5| Model | varchar the) | NO | | NULL | |6| Type | varchar +) | NO | | NULL | |7| name | varchar -) | NO | | NULL | |8| Price | varchar +) | NO | | NULL | |9| Saleprice | varchar +) | NO | | NULL | |Ten| Traderprice | varchar +) | NO | | NULL | | One| Picture | varchar -) | NO | | NULL | | A| Desc | varchar -) | NO | | NULL | | -+-------------+--------------+------+-----+---------+----------------+
Execute the following statement:
Mysql>INSERT INTO product (MODEL,TYPE,NAME,PRICE,SALEPRICE,TRADERPRICE,PICTURE,DESC) VALUES ("Wzc504-tz","Switch","Two-speed"," -","Wuyi"," A","eb3.jpg","");
Get error message:
1ERROR1064(42000): You had an errorinchyour SQL syntax; check the manual that2Corresponds to your MySQL server version forThe right syntax'desc3) VALUES ("Wzc504-tz","Switch","Two-speed"," -","Wuyi"," A","eb3.jpg","")'At line 1
Cause: The column name overlaps with the MySQL keyword.
That should be the name of DESC, modified to describe, still error. Both of these are MySQL keywords!
Change to description, problem solving.
Mysql ERROR 1064 (42000)