Friday, 13 September 2013

verify or not the column in where clause

verify or not the column in where clause

I need to verify 2 columns but sometimes the second one will be empty then
i need to verify the second column just if it's not empty otherwise it
will just verify the first one
SELECT *
FROM table
WHERE column1 = $_GET['id']
and column2 IS NOT NULL = $_GET['id']

No comments:

Post a Comment