Freddies Create mySQL Table Script

I was trying to use the Freddy tute but get a error message with PHP admin 2.5.3

CREATE TABLE auth (
userid
int(4)
unsigned
zerofill
DEFAULT ‘0000’
NOT NULL
auto_increment,
username varchar(20),
userpassword varchar(20),
PRIMARY KEY (userid)
);

Error

SQL-query :

CREATE TABLE auth( useridint( 4 ) unsignedzerofillDEFAULT ‘0000’ NOT NULL AUTO_INCREMENT ,
username varchar( 20 ) ,
userpassword varchar( 20 ) ,
PRIMARY KEY ( userid )
)

MySQL said:

#1064 - You have an error in your SQL syntax near ‘( 4 ) unsignedzerofillDEFAULT ‘0000’ NOT NULL AUTO_INCREMENT ,username varc’ at line 1

Can anyone see whats wrong with the table creation script ?

try this. meaning copy and paste :slight_smile:


 CREATE TABLE auth (
   userid int(4) unsigned zerofill NOT NULL auto_increment,
   username varchar(20) default NULL,
   userpassword varchar(20) default NULL,
   PRIMARY KEY  (userid)
 ) TYPE=MyISAM;
 
 

Hey thanks for that ol4pr0 worked a treat…

I have read mySQL stuff and made my own tables manually from DOS etc. but I still need a book infront of me to read commands/syntax from and can’t see errors cause I dont know it well enough.

Anyway everything makes sense to me except
TYPE=MyISAM;

I haven’t seen that before, care to comment on what that is ?

And thanks again :slight_smile:

MyISAM is the table type. This determines bits and pieces about how the table is structured in the database and so on

However it would of worked witout the MyISAME aswell :slight_smile:

Sweet… will no doubt come accross it again as I learn more… :slight_smile: