Thanks for the responses but after "copying and pasting" this into the
>mysql command prompt I now 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
condition varchar(10) NOT NULL default '', 
City varchar(20) NOT NULL default '', at line 8

I copy this exactly like it is: 

CREATE TABLE 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 ;

And it still isn't working!!! 
WHAT am I doing wrong here? 

Thanks again for the help. 



-----Original Message-----
From: Michael Stassen [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, April 06, 2004 2:05 PM
To: Marvin Cummings
Cc: [EMAIL PROTECTED]
Subject: Re: Need help creating table...

Marvin Cummings wrote:

> 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
> 
> CREATE TABLE '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'm typing this exactly as it appears but it's not working. I also try to
> create this table in phpMyAdmin but have a question: 

The problem is that you used single quotes (') instead of backticks (`) 
around your column names.

My advice: Don't type, copy and paste!  Copy the create table statement in 
its entirety, connect to mysql with the command line client, and paste.

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

This is the default value for the column, so you would enter the value after

the word default in the column definition.  For example, 'No' for column
paypal.

Michael


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


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

Reply via email to