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]



Reply via email to