p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   PHP Databases (http://p2p.wrox.com/forumdisplay.php?f=97)
-   -   CREATE TABLE error in MySQL (http://p2p.wrox.com/showthread.php?t=7047)

k4rm4killer December 9th, 2003 07:33 AM

CREATE TABLE error in MySQL
 
i am trying to create a table in a mySQL database:

CREATE TABLE mailinglist_ger (
id int(16) NOT NULL auto_increment,
username varchar(64) NOT NULL default'',
domain varchar(64) NOT NULL default'',
PRIMARY KEY(id)
)TYPE=MyISAM;

And I get the following error:

MySQL said:

You have an error in your SQL syntax near '\'\', domain varchar(64) NOT NULL default\'\', PRIMARY KEY(id) )TYPE=MyISAM' at line 3

But their are no backslashes?????

Please could you help... I am really really stuck

CFerthorney December 9th, 2003 09:24 AM

I presume by leaving the speach marks blank you intend on setting the default on being blank? Is this the case? Well as you state the type should be not null, try putting a space between your ' ' marks. It is not ideal but it works (I checked it using MySQL 4.0.16)

HTH

---
David Thorne, Student
UK

nikolai December 9th, 2003 01:05 PM

Also, you should probably have a space between default and ''. I don't know offhand if the lack of space causes problems for the query parser.



Take care,

Nik
http://www.bigaction.org/


All times are GMT -4. The time now is 02:32 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.