警告: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");
}