MySQL Forums
Forum List  »  Quality Assurance

Syntax error MySQL server version
Posted by: terry tatenda
Date: October 23, 2012 05:36PM

help me with debugging im getting this error when i run my code

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 '(100) NULL, PRIMARY KEY (id), UNIQUE KEY email(email) )' at line 17



$query="CREATE TABLE myMembers(
id int(11)NOT NULL auto_increment,
firstname varchar(100)NOT NULL,
middlename varchar(100) NULL,
lastname varchar(100)NOT NULL,
country varchar(100) NOT NULL,
state varchar(100) NULL,
city varchar(100) NOT NULL,
zip varchar(100) NULL,
phone varchar(100) NOT NULL,
email varchar(100) NOT NULL,
password varchar(100) 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(100) NULL,
youtubevarchar(100) NULL,

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>";
}
?>
</body>
</html>

Options: ReplyQuote


Subject
Views
Written By
Posted
Syntax error MySQL server version
1974
October 23, 2012 05:36PM


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.