用php和mysql更新信息

klh5stk1  于 2021-06-24  发布在  Mysql
关注(0)|答案(0)|浏览(227)

请告诉我我做错了什么。我想可能有 $_POST 错误,但我是新的php和只是需要一只手。

<?php

include("config.php");
if(isset($_POST['submit']))
{

$medical=$_POST['medicalin'];

    if($medical=='')
    {
        echo"<script>alert('Please enter some Medical Information, if there is none to report, simply type N/A.')</script>";
       exit();
    }

//updating
$query = "UPDATE test SET medical= '$medical' WHERE id=".$user['id'];

if(mysql_query($query)) {
    echo"<script>window.open('/success','_self')</script>"; }

else {
   echo "There was an error updating your medical information, please contact us immediately.";}

}

?>

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题