解析错误:PHP中的语法错误,mysql数据库连接?

时间:2018-04-23 18:25:11

标签: php html mysql xampp

意外'如果' (T_IF)在第19行的C:\ xampp \ htdocs \ forms \ insert1.php中。第19行是if(!mysqli_query($ con,$ query))。请帮帮我?

   <?php
    $con=mysqli_connect("localhost","root","", CSF);

    if(mysqli_connect_errno()){
    echo "Connection Failed".mysqli_connect_errno();
    }
    else{
    echo"connected";}
    if (isset($_POST['submit']))
    {
        $LastName   = $_POST['LastName'];
        $FirstName  = $_POST['FirstName'];
        $MiddleName = $_POST['MiddleName'];
        $email      = $_POST['email'];
        $query="INSERT INTO Info(FirstName, MiddleName, LastName, email)
    VALUES($FirstName, $MiddleName, $LastName, $email)";

     
    if (!mysqli_query($con,$query))
     {
      die('Error: ' . mysqli_error($con));
      }

    echo "1 record added";
     
    mysql_close($con);
     }
    ?>

0 个答案:

没有答案