阅读背景:

在查询中使用PHP变量时,MySQL错误1064

来源:互联网 
<?php
    session_start();
    $con = mysqli_connect("localhost","root","12369","medical");
    $data1 = $_SESSION["symp1"];
    $data2 = $_SESSION["symp2"];
    $data3 = $_SESSION["symp3"];
    $data4 = $_SESSION["symp4"];
    $finalData = implode(' ', array($data1, $data2, $data3, $data4));
    $userinput = $_REQUEST["answer"];
    $dname=$_SESSION["dname"];
    $dname = str_replace(' ', '_', $dname);
    echo $dname."  <br>";
    $sql = " UPDATE diseases SET UserInput = $finalData WHERE Name =   $dname ";
    if($userinput=='yes'){  
        if(mysqli_query($con,$sql)){
            echo "Values inserted";
            $_SESSION["info"] = "yes";
            header('Location: https://localhost/medical/last.php');
    }else{
            echo mysqli_errno($con);
            $_SESSION["info"] = "no";
            //header('Location: https://localhost/medical/last.php');
    }
   }
?>
<?php
    session_start();
    $con = mysqli_co



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: