RE: Update Query Help...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> -----Original Message-----
> From: NIPP, SCOTT V (SBCSI) [mailto:sn4265@sbc.com]
> Sent: 10 December 2002 20:02
> 
> 	I have definitely isolated the problem.  If I change 
> the column name
> that the match is being performed on from 'id-sys' to 
> 'id_sys' I can execute
> the query without having to worry about quoting the column name and
> everything works.  I think that I am just going to leave the 
> column name
> changed and take this as a lesson never to use '-' in a 
> column name again.

Well, if you stop to think about this for a second, it may occur to you to wonder how MySQL is supposed to tell the difference between the column name id-sys, and the expression id-sys (i.e. the value of the id column minus the value of the sys column).  The answer is that you have to demarcate a column name like this that is ambiguous -- and in MySQL that's with ` back ticks.  (Other databases have other means of doing this -- or just restrict column names to avoid the issue!)

Cheers!

Mike

---------------------------------------------------------------------
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: m.ford@lmu.ac.uk
Tel: +44 113 283 2600 extn 4730      Fax:  +44 113 283 3211 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux