简体   繁体   中英

PHP MyAdmin SQL isn't Allowing me to Alter MySQL Table and Giving the Error #1064

I am trying to alter an existing table using the PHP MyAdmin run SQL. I have typed in the code ALTER TABLE file ADD orderid int(11)NOT NULL ADD title varchar(200) NOT NULL ADD description VARCHAR(700) NOT NULL ADD make VARCHAR(100) NOT NULL ADD model VARCHAR(100) NOT NULL ADD year VARCHAR(50) NOT NULL ADD price VARCHAR(150) NOT NULL

and I am getting the error #1064 - 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 'ADD title varchar(200) NOT NULL ADD description VARCHAR(700) NOT NULL ADD make' at line 3 #1064 - 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 'ADD title varchar(200) NOT NULL ADD description VARCHAR(700) NOT NULL ADD make' at line 3 .

Thank you, for any help. I appreciate all help.

You're missing commas after each column:

ALTER TABLE file 
ADD orderid int(11)NOT NULL, -- <-- HERE
ADD title varchar(200) NOT NULL , -- <-- HERE

etc

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM