嘿,我正在尝试建立一个模板网站,但它有这个错误。帮我解决一下

时间:2016-07-15 15:51:05

标签: php html mysqli

  

警告:mysqli_query()要求参数1为mysqli,在第102行的C:\ xampp \ htdocs \ cms \ includes \ function.php中给出字符串

     

警告:mysqli_error()期望参数1为mysqli,在第106行的C:\ xampp \ htdocs \ cms \ includes \ function.php中给出null   QUERY FAILED

    $query="INSERT INTO soldiers 
                (soldier_username,soldier_first_name,soldier_last_name,soldier_surname,
                 soldier_address,date_recruited,soldier_age,soldier_mobile_no,
                 soldier_email,soldier_password,soldier_rank,soldier_status) ";

    $query="VALUES('{$soldier_username}','{$soldier_first_name}','{$soldier_last_name}','{$soldier_surname}',
                   '{$soldier_address}',now(),'{$soldier_age}','{$soldier_mobile_no}',
                   '{$soldier_email}','{$soldier_password}','Unranked','Pending')";

    $register=mysqli_query($connection,$query);
    }
    if(!$register)
    {
         die('QUERY FAILED' . mysqli_error($connection));
    }
    redirect("index.php");
}

0 个答案:

没有答案