Field name DESC

2006-07-13 Thread Anthony

Hello,

i want to know how i can create a table with the feild name desc ?

when i do:


CREATE TABLE bank (
 name varchar(50) NOT NULL default '',
 desc varchar(50) NOT NULL default '',
)

the desc is badely interpreted...




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



Re: Field name DESC

2006-07-13 Thread Alec . Cawley
DESC is a reserved word in MySQL: it is short for DESCENDING and is used 
to reverse the sort order in SELECTs. You an create a field with that name 
by enclosing it in backticks: `desc` whenever you need it. However, this 
would be regarded by many as very bad practice. It would be better to 
change the field name e.g. to descr or even description. Making the 
field name longer and more meaningful costs next to nothing.

Alec




Anthony [EMAIL PROTECTED] 
13/07/2006 16:42

To
mysql@lists.mysql.com
cc

Subject
Field name DESC






Hello,

i want to know how i can create a table with the feild name desc ?

when i do:


CREATE TABLE bank (
  name varchar(50) NOT NULL default '',
  desc varchar(50) NOT NULL default '',
)

the desc is badely interpreted...




-- 
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]



Re: Field name DESC

2006-07-13 Thread Saline Erik

How about desc_  ?

Erik


On Jul 13, 2006, at 8:42 AM, Anthony wrote:


Hello,

i want to know how i can create a table with the feild name desc ?

when i do:


CREATE TABLE bank (
 name varchar(50) NOT NULL default '',
 desc varchar(50) NOT NULL default '',
)

the desc is badely interpreted...




--  
MySQL General Mailing List

For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED] 
tec.com







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



Re: Field name DESC

2006-07-13 Thread Miles Thompson

At 12:42 PM 7/13/2006, Anthony wrote:


Hello,

i want to know how i can create a table with the feild name desc ?

when i do:


CREATE TABLE bank (
 name varchar(50) NOT NULL default '',
 desc varchar(50) NOT NULL default '',
)

the desc is badely interpreted...



In a word - DON'T.  DESC is a reserved word - if it is an abbreviation 
for description, use descr, if for descending, try dscnd.


Use of reserved words for field names is bad practice and is guaranteed to 
cause grief in the future.


Cheers - Miles Thompson 



--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.1.394 / Virus Database: 268.9.10/387 - Release Date: 7/12/2006



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



re[2]: Field name DESC

2006-07-13 Thread Rob Desbois
I'd have to agree with Alec here (over Erik's response).
There's no technical reason, surely, to use 'desc' instead of 'description' - 
people always seem afraid of using non-abbreviated fieldnames / function names 
/ variable names. Whilst it may add a little more to your typing, it adds so 
much to the making your system more understandable.
Code is immediately readable, the DB schema is more obvious, result: the whole 
system is improved.

/2 pennies' worth
--Rob


 DESC is a reserved word in MySQL: it is short for DESCENDING and is used 
to reverse the sort order in SELECTs. You an create a field with that name 
by enclosing it in backticks: `desc` whenever you need it. However, this 
would be regarded by many as very bad practice. It would be better to 
change the field name e.g. to descr or even description. Making the 
field name longer and more meaningful costs next to nothing.

   Alec




Anthony [EMAIL PROTECTED] 
13/07/2006 16:42

To
mysql@lists.mysql.com
cc

Subject
Field name DESC






Hello,

i want to know how i can create a table with the feild name desc ?

when i do:


CREATE TABLE bank (
 name varchar(50) NOT NULL default '',
 desc varchar(50) NOT NULL default '',
)

the desc is badely interpreted...




-- 

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]


__
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
__




-- Original Message --

FROM:  [EMAIL PROTECTED]
TO:[EMAIL PROTECTED]
DATE:  Thu, 13 Jul 2006 17:01:10 +0100

SUBJECT:   Re: Field name DESC

DESC is a reserved word in MySQL: it is short for DESCENDING and is used 
to reverse the sort order in SELECTs. You an create a field with that name 
by enclosing it in backticks: `desc` whenever you need it. However, this 
would be regarded by many as very bad practice. It would be better to 
change the field name e.g. to descr or even description. Making the 
field name longer and more meaningful costs next to nothing.

   Alec




Anthony [EMAIL PROTECTED] 
13/07/2006 16:42

To
mysql@lists.mysql.com
cc

Subject
Field name DESC






Hello,

i want to know how i can create a table with the feild name desc ?

when i do:


CREATE TABLE bank (
 name varchar(50) NOT NULL default '',
 desc varchar(50) NOT NULL default '',
)

the desc is badely interpreted...




-- 

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]


__
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
__


__
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
__

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