RE: Need help creating table...
That did it. I really do appreciate all of the help that I received from you and the list. Thanks again. :) -Original Message- From: Michael Stassen [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 06, 2004 7:52 PM To: Marvin Cummings Cc: [EMAIL PROTECTED] Subject: Re: Need help creating table... Sorry. I can imagine how frustrated you must be. In mysql 5, condition is a reserved word, so the person who told you to remove the quotes was wrong, at least for that column. (In his defense, CONDITION is relevant to stored procedures, so it isn't a reserved word for versions prior to 5, as far as I know.) You will need to put bacticks around the column name, like this `condition` varchar(10) NOT NULL default '', Michael Marvin Cummings wrote: 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. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
RE: Need help creating table...
Hi, the table name and the column names dont have to be inclosed by ' '. Carlos Original Message Follows From: Marvin Cummings [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Need help creating table... Date: Tue, 6 Apr 2004 12:29:48 -0400 _ From: Marvin Cummings [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 06, 2004 9:26 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Need help creating table... 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: 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? I'm using MySQL5.0alpha w/PHP4.3.4 on W2K3. Thanks _ The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=features/junkmail -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Need help creating table...
Marvin Cummings writes: I attempt to create this table from the command line and get the following error: Marvin, the use of the ' [single quote] appears to be your problem. I've been able to create the table on 4.0.18 using the following syntax: 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 ; Brad Eacker ([EMAIL PROTECTED]) -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
Re: Need help creating table...
Looks like you are using backticks instead of single quotes on your column names. You don't really need the quotes on your table name or column names anyway, so I'd just remove them. On Tue, 2004-04-06 at 09:29, Marvin Cummings wrote: _ From: Marvin Cummings [mailto:[EMAIL PROTECTED] Sent: Tuesday, April 06, 2004 9:26 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Need help creating table... 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: 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? I'm using MySQL5.0alpha w/PHP4.3.4 on W2K3. Thanks -- |- Garth Webb -| |- [EMAIL PROTECTED] -| signature.asc Description: This is a digitally signed message part
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]
Re: Need help creating table...
Sorry. I can imagine how frustrated you must be. In mysql 5, condition is a reserved word, so the person who told you to remove the quotes was wrong, at least for that column. (In his defense, CONDITION is relevant to stored procedures, so it isn't a reserved word for versions prior to 5, as far as I know.) You will need to put bacticks around the column name, like this `condition` varchar(10) NOT NULL default '', Michael Marvin Cummings wrote: 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. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]
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]