Error: Sql query, create table statement
I have created a script for creating a database in phpmyadmin, but when I import the script and run it, I get this error:
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 '--create the table
CREATE TABLE profile (
studentID INT NOT NULL AUTO_IN' at line 3
I have read through the questions and answers of such an error at this site, but none has helped in my case. I have tried changing the table name, and the type 'INT' to 'INT(11)'.
So here is the part of the script:
/*****************************************
* Create the students_personal_profiles database
*****************************************/
DROP DATABASE IF EXISTS students_personal_profiles;
CREATE DATABASE students_personal_profiles;
USE students_personal_profiles; -- MySQL command
--create the table
CREATE TABLE profile (
studentID INT NOT NULL AUTO_INCREMENT,
firstName VARCHAR(25) NOT NULL,
secondName VARCHAR(25) NOT NULL,
dateOfBirth DATE NOT NULL,
gender CHAR(2) NOT NULL,
email VARCHAR(30) NOT NULL,
PRIMARY KEY (studentID),
UNIQUE INDEX email (email)
);
Please help, thanks.
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 '--create the table
CREATE TABLE profile (
studentID INT NOT NULL AUTO_IN' at line 3
I have read through the questions and answers of such an error at this site, but none has helped in my case. I have tried changing the table name, and the type 'INT' to 'INT(11)'.
So here is the part of the script:
/*****************************************
* Create the students_personal_profiles database
*****************************************/
DROP DATABASE IF EXISTS students_personal_profiles;
CREATE DATABASE students_personal_profiles;
USE students_personal_profiles; -- MySQL command
--create the table
CREATE TABLE profile (
studentID INT NOT NULL AUTO_INCREMENT,
firstName VARCHAR(25) NOT NULL,
secondName VARCHAR(25) NOT NULL,
dateOfBirth DATE NOT NULL,
gender CHAR(2) NOT NULL,
email VARCHAR(30) NOT NULL,
PRIMARY KEY (studentID),
UNIQUE INDEX email (email)
);
Please help, thanks.