deejay wrote:yeah, we'll probably need to see more code. however
doesn't look right to me. do you have a field called '1' and are you asking the query to match to 'Alabama'. I don't consider myself an expert on this but you'll probably want to have a look at the guide for mysql
No, he doesn't. That is how people
should write queries. It makes a lot more sense when you have several where clauses, eg:
[sql]SELECT `City` FROM `citystatecountry` WHERE 1 AND `State` = 'Alabama' AND `Col2` = '2' AND `Col3` = '3' AND `Col4` = '4' ORDER BY `City` ASC[/sql]
By putting the 1 at the start you can start each clause with it's boolean operation. Without the 1 it looks like:
[sql]SELECT `City` FROM `citystatecountry` WHERE `State` = 'Alabama' AND `Col2` = '2' AND `Col3` = '3' AND `Col4` = '4' ORDER BY `City` ASC[/sql]
That's not as readable.
All the "1" means is "always match this" (because it's a positive assertion), so the query is "Always match this, AND match where `state` = 'alabama', AND match where `Col2` = 2" and so on.