简体   繁体   中英

I keep getting Error Message 1064 when running create table

I'm new to PHP and MySQL and ran into a little trouble with a project I'm working on. I keep getting an error message #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 '','

Table structure for table ea_cellcarrier

CREATE TABLE IF NOT EXISTS ea_cellcarrier(
id INT NOT NULL AUTO_INCREMENT  ',' PRIMARY KEY (  `id` ) ,
cellco VARCHAR( 30 )  ','cellurl VARCHAR( 30 )
)

Constraints for dumped tables

Constraints for table ea_appointments

ALTER TABLE  `ea_appointments` 
ADD CONSTRAINT  `ea_appointments_ibfk_2` 
                 FOREIGN KEY (  `id_users_customer` ) 
                 REFERENCES  `ea_users` (  `id` ) ON DELETE CASCADE ON UPDATE CASCADE ,
ADD CONSTRAINT  `ea_appointments_ibfk_3` 
                 FOREIGN KEY (  `id_services` ) 
                 REFERENCES  `ea_services` (  `id` ) ON DELETE CASCADE ON UPDATE CASCADE ,
ADD CONSTRAINT  `ea_appointments_ibfk_4` 
                 FOREIGN KEY (  `id_users_provider` ) 
                 REFERENCES  `ea_users` (  `id` ) ON DELETE CASCADE ON UPDATE CASCADE ;

MySQL said: Documentation

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 '',' PRIMARY KEY ( id ), cellco VARCHAR(30)',' cellurl VARCHAR(30)) Co' at line 5

CREATE TABLE IF NOT EXISTS ea_cellcarrier
(
  id INT NOT NULL AUTO_INCREMENT, 
  cellco  VARCHAR(30) ,
  cellurl VARCHAR(30) ,
  PRIMARY KEY (`id`) 
)

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