I'm wanting to do something like mysql_query("SELECT * FROM Table WHERE value='true' OR value2='true' OR value3='true'"); but I'm not sure what the correct syntax should be for the 'OR'. I've tried using the exact word OR but it doesnt seem to like it. Any ideas?
What error are you getting ? Make sure value1..n are declared boolean in db Try mysql_query("SELECT * FROM Table WHERE (value='true') OR (value2='true') OR (value3='true') "); If you have phpMyAdmin - Use it's query builder to build the query for you.
Thanks sadcox, I've been coding it in PHP for the mysql database and I do have phpmyAdmin so I'll check that out and see if I can get it to work there. Is OR definitely the word to use for doing ORs?
Looks like it could be some other syntax error that I've made because my query that I had worked properly. Thanks for your help though sadcox.
Good luck with it. If you post the error message I may be able to give more information. I am guessing at this point the error message is probably from PHP. +By the way most server administrators (cPanel/Plesk) already have phpMyAdmin already installed if you need to debug further.
It was a human error that I made for the OR not to work. I had actually written the right query but forgot to display the results correctly for the query I had scripted. Sometimes it just takes a wee while to notice the errors though