mysql help
mysql help
- Started
- Last post
- 4 Responses
- jpea
i googled around but can't seem to find anything on it. how would you select items from mysql that might fit multiple criteria?
ie :
SELECT * FROM mytable WHERE Section='somesection' or Section='someother' AND Posted='2006-01-01 01:01:01' order by Posted DESCthe above doesn't seem to work. it pulls the whole database unless i take out the or Section='someother'
- cosmo0
Place parenthesis around the two OR statements. It should work. Let me know.
SELECT * FROM mytable WHERE (Section='somesection ' or Section='someother') AND Posted='2006-01-01 01:01:01' order by Posted DESC
- jpea0
worked great, thanks!
- cosmo0
fantastic.
- acescence0
also works without parens and OR operator ||