Page 2 of 2

Posted: Fri Jun 29, 2007 10:24 am
by ReverendDexter
feyd wrote:
ReverendDexter wrote:And is it intentional that your variable is the column name instead of the value?
I'm pretty sure that is perfectly valid.
I agree, he may be trying to match known field values to a variable-specified column, which would be totally valid, however, testing on my system if I switch the order of column name and value, I get this:

Code: Select all

SELECT *
FROM cities
WHERE 'chico' = city
LIMIT 0 , 30 

Code: Select all

MySQL said:  
#1054 - Unknown column 'city' in 'where clause'
So I just wanted to make sure that what he was doing was intentional. :)