-----Original Message-----
From: Marvin Cummings [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, April 06, 2004 3:11 AM
To: 'Michael Stassen'
Subject: RE: Need help creating table using phpMyAdmin

I attempt to create this table from the command line and get the following
error: 
Error 1064 (42000): You have an error in your SQL syntax. Check the manual
that corresponds to your MySQL version for the right syntax to use near
''ad_id' smallint(5) unsigned NOT NULL auto_increment, 
'cat_id' smallint(5) unsign' at line 3

I'm typing this exactly as it appears but it's not working. I also try to
create this table in phpMyAdmin: 
Field  Type         
ad_id  SmallInt 5              

Length/Values
5

Charset
Latin1

Attributes
unsigned

Null
Not_null

Default**
?????     

Extra
auto_increment   

I'm not sure what to enter for Default**. Can someone tell me what I'm
missing? 

Thanks

-----Original Message-----
From: Michael Stassen [mailto:[EMAIL PROTECTED] 
Sent: Monday, April 05, 2004 2:34 AM
To: Marvin Cummings
Cc: [EMAIL PROTECTED]
Subject: Re: Need help creating table using phpMyAdmin


Marvin Cummings wrote:

> Sorry for this easy question but I'm kind of a newbie and I'm wondering if
> someone could assist me with creating a new table for a postnuke module? I
> need to copy the following content into a table I create named
nuke_zc_ads: 
> (
> `ad_id` smallint(5) unsigned NOT NULL auto_increment,
> `cat_id` smallint(5) unsigned NOT NULL default '0',
> `user_name` varchar(20) NOT NULL default '',
> `email` varchar(50) NOT NULL default '',
> `price` text NOT NULL,
> `condition` varchar(10) NOT NULL default '',
> `city` varchar(20) NOT NULL default '',
> `state` varchar(20) NOT NULL default '',
> `country` varchar(20) NOT NULL default '',
> `lastup_date` int(11) NOT NULL default '0',
> `subject` text NOT NULL,
> `descript` text NOT NULL,
> `url` text NOT NULL,
> `views` int(11) NOT NULL default '0',
> `paypal` char(3) NOT NULL default 'No',
> `add_date` int(11) NOT NULL default '0',
> `exp_date` int(11) NOT NULL default '0',
> PRIMARY KEY (`ad_id`)
> ) TYPE=MyISAM AUTO_INCREMENT=1 ;
> 
> I see where to create the table but I'm not sure about the number of
fields
> to add. My instincts are telling me I need 18 fields but I just need to
> confirm. 

17 would do, so long as you check the "primary" button on the first one 
(ad_id), but this would be much simpler to do with the mysql client. 
Connect with

   mysql -u root -p nameofdb

replacing "nameofdb" with whatever you've named the database this table will

belong to.  After you've supplied the password and gotten in, enter

   CREATE TABLE nuke_zc_ads
   (
   `ad_id` smallint(5) unsigned NOT NULL auto_increment,
    .
    .
    .
   ) TYPE=MyISAM AUTO_INCREMENT=1 ;

In other words, copy what you have above and paste it in after entering the 
"CREATE TABLE" line.  That's it -- you're done -- table created.  You could 
do it with phpmyadmin, but it'll take awhile filling in all those boxes.

> Any responses are appreciated.

Michael



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to