我试图让下面的代码工作,但它不工作并给我下面的错误
Fatal error: Call to a member function bind_param() on a non-object in
有没有办法用准备好的语句获取数组?
if (move_uploaded_file($_FILES['file_to_upload']['tmp_name'], $final_uploads_location))
{
$stmt = $mysqli->prepare("select * from test where `username` = ? and `age` = ? ");
$stmt->bind_param('ss', $username, $age);
$stmt->store_result();
$stmt->execute();
if($stmt->num_rows < 1)
{
$insert = $mysqli->prepare("insert into `test`(`username`, `age`, ) values(?,?)");
$insert->bind_param('ss', $username, $age);
$insert->execute();
}
else
{
$check = mysqli_fetch_array($stmt);
global $identity;
}
}