更新操作不起作用?这段代码有什么问题吗

时间:2018-12-03 12:21:31

标签: php mysql mysqli

更新操作不起作用,请告诉我此代码中有任何错误。我的表格有3个不同的字段,分别是姓名,手机,电子邮件。我想更新这个。请告诉我我误会了...

<?php 
     session_start();
     $name = $_SESSION['mobile'];
     $conn = mysqli_connect("localhost","root","","hoysalat_temple");

    if(isset($_SESSION['newid']))
    {
        // header("location:index.php");

    }
    else
    {
        header("location:../index.php");
    }

      if($_POST["update"]) {
         $name_save = $_POST['name'];
         $mobile_save = $_POST['mobile'];
         $email_save = $_POST['email'];  
       $update="update temp_web_users set name='".$name_save."', mobile='".$mobile_save."', email='".$email_save."' where mobile='".$name."'";

    mysqli_query($con, $update) or die(mysqli_error());

    $status = "Record Updated Successfully. </br></br>

    }

    ?>

0 个答案:

没有答案