Durgesh Tanwar Durgesh Tanwar - 11 days ago 6
SQL Question

mySQL error not able to locate error. please guide me

Hello I want to make an table in phpmyadmin and I am using SQL command for that

CREATE TABLE userdetail(
detailid INT(255) UNSIGNED AUTO_INCREMENT PRIMARY,
name varchar(255) NOT NULL,
address text,
phone varchar(13) NOT NULL,
email_id varchar(255),
userId int(20) NOT NULL,
reg_date TIMESTAMP
)


I am getting this 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 '
name varchar(255) NOT NULL,
address text,
phone varchar(13) NOT ' at line 2


please guide me to correct it.

Answer

It should be like this

 CREATE TABLE userdetail(    
    detailid INT(255) UNSIGNED AUTO_INCREMENT PRIMARY KEY,
    name varchar(255) NOT NULL,
    address text,
    phone varchar(13) NOT NULL,
    email_id varchar(255),
    userId int(20) NOT NULL,
    reg_date TIMESTAMP);