MySQL Forums
Forum List  »  Quality Assurance

ENUM error in your SQL syntax; check the manual that corresponds to your MySQL server version
Posted by: terry tatenda
Date: October 23, 2012 05:39PM

im getting this error when i run my code how can fix this

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 '(255) NULL, account_type' enum('1','2','3') NOT NULL default '1', email_acti' at line 17


$query="CREATE TABLE myMembers(
id int(11)NOT NULL auto_increment,
firstname varchar(255)NOT NULL,
middlename varchar(255) NULL,
lastname varchar(255)NOT NULL,
country varchar(255) NOT NULL,
state varchar(255) NULL,
city varchar(255) NOT NULL,
zip varchar(255) NULL,
phone varchar(255) NOT NULL,
email varchar(255) NOT NULL,
password varchar(255) NOT NULL,
sign_up_date date NOT NULL default '0000-00-00',
last_log_date date NOT NULL default '0000-00-00',
bio_body text NULL,
website varchar(255) NULL,
youtubevarchar(255) NULL,
account_type' enum('1','2','3') NOT NULL default '1',
email_activated enum('0','1') NOT NULL default '0',
PRIMARY KEY (id),
UNIQUE KEY email(email)
)";

$ret = mysql_query ($query, $connection);

if ($ret) {
echo "<p>Table created!</p>";
}
else {
echo "<p>Something went wrong: " . mysql_error();
+ "</p>";
}
?>



Edited 1 time(s). Last edit at 10/23/2012 05:46PM by terry tatenda.

Options: ReplyQuote


Subject
Views
Written By
Posted
ENUM error in your SQL syntax; check the manual that corresponds to your MySQL server version
7732
October 23, 2012 05:39PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.