I've searched google and haven't found anything yet, but...
Is it possible to get two values when querying?
For example:
mysql_query("SELECT * FROM example WHERE color='red' OR color='blue'") or die;
If this is possible, what is the correct syntax?
That query will get all results that the "color" column is set to red or blue. So rows with "color" set to green would be excluded, as would a "color" column that is set to "blue red".
So if that table is just a list of colors and there is only one row for blue and one row for red yes it will return only those two rows. Else it will return all rows that have red or blue set in the "color" column.
You could also use the IN() function:
SELECT * FROM table_name WHERE color IN('red', 'blue', 'yellow')
@,
Thanks. I got it working perfectly now.
I didn't know about IN() until now. This is going to come in very handy.
Appreciate the feedback!