habester
05-11-2009, 01:45 AM
Hi everyone, this is the first time that I've done much with PHP
My question is how would I include an IF statement within a WHERE clause, so that I can ignore the item if its submitted value is null? $datemonthF and $datedayF are the submitted values.
Here's what I have now:
$query .= "WHERE datemonth = '". $datemonthF ."' and dateday = '". $datedayF ."'";
I'd like to negate each one that has the value null. I could also make it so they are negated if the value is nothing, "", whichever is easier. Thanks for any help!
My question is how would I include an IF statement within a WHERE clause, so that I can ignore the item if its submitted value is null? $datemonthF and $datedayF are the submitted values.
Here's what I have now:
$query .= "WHERE datemonth = '". $datemonthF ."' and dateday = '". $datedayF ."'";
I'd like to negate each one that has the value null. I could also make it so they are negated if the value is nothing, "", whichever is easier. Thanks for any help!