If $a3['rentsale']
is either A) empty
or B) equal
to the form entry for rentsale then this part is true
. It returns TRUE
(manage.php?result=True
) when just this part of the if statement is there. But then when I added the second part (&&
) to the if statement to also see if $a3['propertytype']
is either A) empty
or B) equal
to the form entry for propertytype
chosen it returns FALSE
(manage.php?result=False
). When just the first part was there and also when the second part was added, on the form submission I selected/input the option so they both equal the sql entries ($a3[]
).
What have I done wrong?
$q3 = "select * from alerts";
$r3 = mysql_query($q3) or die(mysql_error());
$a3 = mysql_fetch_array($r3);
if(($a3['rentsale'] == '' || $a3['rentsale'] == $_POST['rentsale']) && ($a3['propertytype'] == '' || $a3['propertytype'] == $_POST['propertytype'])) {
header("location:manage.php?result=True");
exit();
}
else {
header("location:manage.php?result=False");
exit();
}