Mysql表不会通过php脚本更新

时间:2016-01-15 11:17:27

标签: php mysqli sql-update

我有一个通过cronjob运行的脚本,该脚本应该在发送电子邮件后将“已发送”列更新为1。但在我的情况下它没有,这是我的代码

<?php 
if ($sent=$row_odd['sent']==0)
{
    $mail=mail($to,$subject,$msg,$headers);
    if ($mail)
    {
        $email_status=mysqli_query($conn,"UPDATE `hiv_survey`.`hiv_survey_answers` SET `sent` = '1' WHERE `email_address`='".$row_odd['email_address']."'");
        echo '<p>'; echo "Thank You for taking, the survey"." "."your email is"."
        ".$row_odd['email_address']." "."and your serial key is"."
        ".$row_odd['serialkey']; echo $mail;
    }
    else if($sent==1)
    {
        $mail=false;
    }
}
?>

0 个答案:

没有答案