所以,我在这个问题上摸不着头脑。我原来的“IF”语句在为真时没有执行(我知道这是真的,因为我已经回显了变量并且它应该触发代码)。但是,如果 IF 语句不正确,则 elseif 和 else 语句可以正常工作。这是代码:
<?php
$count=mysql_num_rows($result);
// have also tried only one "=" sign//
if ($count==0){
//This is not appearing//
echo "Your search did not yield any results. Please try another search.";
} else if ( //other conditions// ) {
//code that is working fine//
} else {
// more code that is working fine
// (happens to be the same as the original if statement)
}
echo $count; //is printing 0 correctly, but the if statement for $count=0 not happening//
?>
有任何想法吗?