vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hi guys. I have a simple form which has countries to choose from. Once a country is chosen I need to do a select lookup. I can't find the correct symbol for "all" countries in the lookup i.e can someone tell me what I should palce instead of the ? in the following country to lookup all select all countries : SELECT * FROM database WHERE country=? Thank you in advance, Raj (newbie) |
| |||
| On 15 Mar, 13:34, raj <r...@nospam.com> wrote: > Hi guys. I have a simple form which has countries to choose from. Once a > country is chosen I need to do a select lookup. I can't find the correct > symbol for "all" countries in the lookup i.e can someone tell me what I > should palce instead of the ? in the following country to lookup all select > all countries : > > SELECT * FROM database WHERE country=? > > Thank you in advance, > > Raj (newbie) SELECT * FROM database |
| |||
| On Thu, 15 Mar 2007 13:34:05 +0000, raj wrote: > Hi guys. I have a simple form which has countries to choose from. Once a > country is chosen I need to do a select lookup. I can't find the correct > symbol for "all" countries in the lookup i.e can someone tell me what I > should palce instead of the ? in the following country to lookup all select > all countries : > > SELECT * FROM database WHERE country=? = comparisons can't do wildcards. LIKE comparisons can. SELECT * FROM my_table WHERE country LIKE '%'; will pick all. SELECT * FROM my_table WHERE country LIKE 'NZ'; will pick just rows in New Zealand. SELECT * FROM my_table WHERE country LIKE '%X'; will pick all the country codes ending in X. -- 23. I will keep a special cache of low-tech weapons and train my troops in their use. That way--even if the heroes manage to neutralize my power generator and/or render the standard-issue energy weapons useless--my troops will not be overrun by a handful of savages armed with spears. |