Can anyone tell me the syntax for this:
I want to select all records where column A matches a certain criteria AND where column B OR column C has a value.
Most of the time Column B will have a value, but sometimes Column B will be NULL, but Column C will have a value. I want to select that column if either is populated.
I've looked in both of my PHP books and on the mysql site and can't find the answer to this.
I think it should look something like this:
$sql = "SELECT * FROM dbtable
WHERE field1 = 'myvalue' AND (field2 <> '' OR field3 <> '')";
I gotta get this working before I can go home and working Saturdays is the pits 🙁
Thanks