Some of the variables below ( us1 or sp1..) may have null value ( customer has the possibility not to fill the according textviews). How can i syntax "where" clause with only "not null " variables; For example, when us1 is not null and sp1 is null, "where" clause has to be: " where customer.username1 = 'us1' " Thanks in advance
$us1 = $_POST['username1'];
$sp1 = $_POST['startPoli1'];
SELECT `username1`,`startPoli1`, `finalPoli1`,`weight1` ,`phone1`
FROM customer ,registration1
where customer.startPoli1 = 'sp1' and customer.username1 = 'us1'