Re: [PHP-DB] Mysql syntax error - phpMyAdmin ??
Hi, No you should not report it to anyone. Reserved words can be used as column names in MySQL (although you shouldn't) provided that they are surrounded by backticks. When you do it in phpMyAdmin, phpMYAdmin is putting everything inside backticks , so that this problem won't be encountered. See: http://www.mysql.com/doc/L/e/Legal_names.html Gurhan - Original Message - From: "Michael Zornek" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, July 10, 2002 1:30 PM Subject: Re: [PHP-DB] Mysql syntax error - phpMyAdmin ?? > Twas 7/10/02 12:55 PM, when "Martin Clifford" <[EMAIL PROTECTED]> said: > > > DESC is a reserved word in SQL, standing for Descending Order. That is why > > you can't use it as a table column name. > > Ok, that makes sence - thanks! > > Although I find it a bit curious that building the DB in phpMyAdmin let me > do it, yet base MySQL will not. > > Should I report it to the phpMyAdmin team? > > ~ Mike > -- > Mike Zornek | Project Leader > Apple Student Developers > The Insanely Great Site with the Insanely Long URL > http://www.applestudentdevelopers.org > > Personal Site: > http://www.mikezornek.com > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Mysql syntax error - phpMyAdmin ??
Twas 7/10/02 12:55 PM, when "Martin Clifford" <[EMAIL PROTECTED]> said: > DESC is a reserved word in SQL, standing for Descending Order. That is why > you can't use it as a table column name. Ok, that makes sence - thanks! Although I find it a bit curious that building the DB in phpMyAdmin let me do it, yet base MySQL will not. Should I report it to the phpMyAdmin team? ~ Mike -- Mike Zornek | Project Leader Apple Student Developers The Insanely Great Site with the Insanely Long URL http://www.applestudentdevelopers.org Personal Site: http://www.mikezornek.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Mysql syntax error - phpMyAdmin ??
On Thursday 11 July 2002 01:00, Ryan Jameson (USA) wrote: > Sorry, [desc] won't work either. :-( Try `desc`. But it's best not to use 'desc' at all, it will save you confusion in the long run. -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * /* People humiliating a salami! */ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Mysql syntax error - phpMyAdmin ??
Sorry, [desc] won't work either. :-( -Original Message- From: Chip Atkinson [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 10, 2002 10:54 AM To: Michael Zornek Cc: [EMAIL PROTECTED] Subject: Re: [PHP-DB] Mysql syntax error - phpMyAdmin ?? I can't say for sure, but perhaps "desc" is a reserved word, short for describe. What happens if you say something like "description"? Chip On Wed, 10 Jul 2002, Michael Zornek wrote: > I was using phpMyAdmin to do an export from one machine to another and on > import I got an error: > > > Error > > > > SQL-query : > > > > CREATE TABLE hospital ( > > id smallint(5) unsigned NOT NULL auto_increment, > > heath_system_id smallint(5) unsigned default NULL, > > name_long tinytext NOT NULL, > > name_short tinytext, > > logo_file_loc text, > > desc text, > > photo text, > > address1 tinytext, > > address2 tinytext, > > city tinytext, > > state tinytext, > > zip smallint(5) unsigned zerofill default NULL, > > phone tinytext, > > repay_percent tinyint(3) unsigned default NULL, > > url text, > > job_page_url text, > > num_nurses smallint(5) unsigned default NULL, > > active enum('yes','no') NOT NULL default 'yes', > > number_of_beds smallint(5) unsigned NOT NULL default '0', > > type tinytext NOT NULL, > > PRIMARY KEY (id), > > KEY zip (zip) > > ) TYPE=MyISAM > > > > MySQL said: > > > > You have an error in your SQL syntax near 'desc text, > > photo text, > > address1 tinytext, > > address2 tinytext, > > city ti' at line 7 > > What's the problem??? My db seems to find on the other machine? > > ~ Mike > -- > Mike Zornek | Project Leader > Apple Student Developers > The Insanely Great Site with the Insanely Long URL > http://www.applestudentdevelopers.org > > Personal Site: > http://www.mikezornek.com > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Mysql syntax error - phpMyAdmin ??
DESC is a reserved word in SQL, standing for Descending Order. That is why you can't use it as a table column name. HTH Martin >>> Michael Zornek <[EMAIL PROTECTED]> 07/10/02 12:49PM >>> I was using phpMyAdmin to do an export from one machine to another and on import I got an error: > Error > > SQL-query : > > CREATE TABLE hospital ( > id smallint(5) unsigned NOT NULL auto_increment, > heath_system_id smallint(5) unsigned default NULL, > name_long tinytext NOT NULL, > name_short tinytext, > logo_file_loc text, > desc text, > photo text, > address1 tinytext, > address2 tinytext, > city tinytext, > state tinytext, > zip smallint(5) unsigned zerofill default NULL, > phone tinytext, > repay_percent tinyint(3) unsigned default NULL, > url text, > job_page_url text, > num_nurses smallint(5) unsigned default NULL, > active enum('yes','no') NOT NULL default 'yes', > number_of_beds smallint(5) unsigned NOT NULL default '0', > type tinytext NOT NULL, > PRIMARY KEY (id), > KEY zip (zip) > ) TYPE=MyISAM > > MySQL said: > > You have an error in your SQL syntax near 'desc text, > photo text, > address1 tinytext, > address2 tinytext, > city ti' at line 7 What's the problem??? My db seems to find on the other machine? ~ Mike -- Mike Zornek | Project Leader Apple Student Developers The Insanely Great Site with the Insanely Long URL http://www.applestudentdevelopers.org Personal Site: http://www.mikezornek.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Mysql syntax error - phpMyAdmin ??
I can't say for sure, but perhaps "desc" is a reserved word, short for describe. What happens if you say something like "description"? Chip On Wed, 10 Jul 2002, Michael Zornek wrote: > I was using phpMyAdmin to do an export from one machine to another and on > import I got an error: > > > Error > > > > SQL-query : > > > > CREATE TABLE hospital ( > > id smallint(5) unsigned NOT NULL auto_increment, > > heath_system_id smallint(5) unsigned default NULL, > > name_long tinytext NOT NULL, > > name_short tinytext, > > logo_file_loc text, > > desc text, > > photo text, > > address1 tinytext, > > address2 tinytext, > > city tinytext, > > state tinytext, > > zip smallint(5) unsigned zerofill default NULL, > > phone tinytext, > > repay_percent tinyint(3) unsigned default NULL, > > url text, > > job_page_url text, > > num_nurses smallint(5) unsigned default NULL, > > active enum('yes','no') NOT NULL default 'yes', > > number_of_beds smallint(5) unsigned NOT NULL default '0', > > type tinytext NOT NULL, > > PRIMARY KEY (id), > > KEY zip (zip) > > ) TYPE=MyISAM > > > > MySQL said: > > > > You have an error in your SQL syntax near 'desc text, > > photo text, > > address1 tinytext, > > address2 tinytext, > > city ti' at line 7 > > What's the problem??? My db seems to find on the other machine? > > ~ Mike > -- > Mike Zornek | Project Leader > Apple Student Developers > The Insanely Great Site with the Insanely Long URL > http://www.applestudentdevelopers.org > > Personal Site: > http://www.mikezornek.com > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Mysql syntax error - phpMyAdmin ??
Try [desc] -Original Message- From: Ryan Jameson (USA) Sent: Wednesday, July 10, 2002 10:51 AM To: [EMAIL PROTECTED] Subject: RE: [PHP-DB] Mysql syntax error - phpMyAdmin ?? desc is a key word. :-\ -Original Message- From: Michael Zornek [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 10, 2002 10:50 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] Mysql syntax error - phpMyAdmin ?? I was using phpMyAdmin to do an export from one machine to another and on import I got an error: > Error > > SQL-query : > > CREATE TABLE hospital ( > id smallint(5) unsigned NOT NULL auto_increment, > heath_system_id smallint(5) unsigned default NULL, > name_long tinytext NOT NULL, > name_short tinytext, > logo_file_loc text, > desc text, > photo text, > address1 tinytext, > address2 tinytext, > city tinytext, > state tinytext, > zip smallint(5) unsigned zerofill default NULL, > phone tinytext, > repay_percent tinyint(3) unsigned default NULL, > url text, > job_page_url text, > num_nurses smallint(5) unsigned default NULL, > active enum('yes','no') NOT NULL default 'yes', > number_of_beds smallint(5) unsigned NOT NULL default '0', > type tinytext NOT NULL, > PRIMARY KEY (id), > KEY zip (zip) > ) TYPE=MyISAM > > MySQL said: > > You have an error in your SQL syntax near 'desc text, > photo text, > address1 tinytext, > address2 tinytext, > city ti' at line 7 What's the problem??? My db seems to find on the other machine? ~ Mike -- Mike Zornek | Project Leader Apple Student Developers The Insanely Great Site with the Insanely Long URL http://www.applestudentdevelopers.org Personal Site: http://www.mikezornek.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Mysql syntax error - phpMyAdmin ??
desc is a key word. :-\ -Original Message- From: Michael Zornek [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 10, 2002 10:50 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] Mysql syntax error - phpMyAdmin ?? I was using phpMyAdmin to do an export from one machine to another and on import I got an error: > Error > > SQL-query : > > CREATE TABLE hospital ( > id smallint(5) unsigned NOT NULL auto_increment, > heath_system_id smallint(5) unsigned default NULL, > name_long tinytext NOT NULL, > name_short tinytext, > logo_file_loc text, > desc text, > photo text, > address1 tinytext, > address2 tinytext, > city tinytext, > state tinytext, > zip smallint(5) unsigned zerofill default NULL, > phone tinytext, > repay_percent tinyint(3) unsigned default NULL, > url text, > job_page_url text, > num_nurses smallint(5) unsigned default NULL, > active enum('yes','no') NOT NULL default 'yes', > number_of_beds smallint(5) unsigned NOT NULL default '0', > type tinytext NOT NULL, > PRIMARY KEY (id), > KEY zip (zip) > ) TYPE=MyISAM > > MySQL said: > > You have an error in your SQL syntax near 'desc text, > photo text, > address1 tinytext, > address2 tinytext, > city ti' at line 7 What's the problem??? My db seems to find on the other machine? ~ Mike -- Mike Zornek | Project Leader Apple Student Developers The Insanely Great Site with the Insanely Long URL http://www.applestudentdevelopers.org Personal Site: http://www.mikezornek.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Mysql syntax error - phpMyAdmin ??
I was using phpMyAdmin to do an export from one machine to another and on import I got an error: > Error > > SQL-query : > > CREATE TABLE hospital ( > id smallint(5) unsigned NOT NULL auto_increment, > heath_system_id smallint(5) unsigned default NULL, > name_long tinytext NOT NULL, > name_short tinytext, > logo_file_loc text, > desc text, > photo text, > address1 tinytext, > address2 tinytext, > city tinytext, > state tinytext, > zip smallint(5) unsigned zerofill default NULL, > phone tinytext, > repay_percent tinyint(3) unsigned default NULL, > url text, > job_page_url text, > num_nurses smallint(5) unsigned default NULL, > active enum('yes','no') NOT NULL default 'yes', > number_of_beds smallint(5) unsigned NOT NULL default '0', > type tinytext NOT NULL, > PRIMARY KEY (id), > KEY zip (zip) > ) TYPE=MyISAM > > MySQL said: > > You have an error in your SQL syntax near 'desc text, > photo text, > address1 tinytext, > address2 tinytext, > city ti' at line 7 What's the problem??? My db seems to find on the other machine? ~ Mike -- Mike Zornek | Project Leader Apple Student Developers The Insanely Great Site with the Insanely Long URL http://www.applestudentdevelopers.org Personal Site: http://www.mikezornek.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php