0

请,任何人都可以帮助我理解为什么如果不工作?我回显变量以检查值,并且我有各自的 0 和 1,相同的 IF 条件...查询有效,IF 无效...

$data = ($_POST);
$cn = $data['cn'];
$email = $data['email'];

$con1 = mysql_query("SELECT * FROM `crm` WHERE cn = '$cn'", $con);
$num_cn = mysql_num_rows($con1);

$con2 = mysql_query("SELECT * FROM `crm_contacts` WHERE email = '$email'", $con);
$num_email = mysql_num_rows($con2);

        echo $num_cn;
        echo "<br>";
        echo $num_email;

 if ($num_cn == "0" && $num_email == "1") {
    echo "<script type='text/javascript'>"; 
echo "location.href='crm.php?Error=2;"; 
echo "</script>";
 exit;
 }
4

1 回答 1

0

在:

echo "location.href='crm.php?Error=2;"; 

你错过了结束'

echo "location.href='crm.php?Error=2';";
//                                  ^ 
于 2013-03-31T23:29:41.850 回答