您好我有以下内容:
$query = "select * from test_admin_users where school_id=? and username=?";
$stmt = $mysqli->prepare($query);
$stmt->bind_param("is", $school_id,$username);
$username='jones';
$school_id=11;
$stmt->execute();
哪个按预期工作。作为mysqli_的新手,我玩了bind_param类型并找到了
$stmt->bind_param("ss", $school_id,$username);
$stmt->bind_param("ii", $school_id,$username);
两者都给出了预期的结果。为什么接受不正确的类型?
此外,有没有办法在查询模板中使用 username 等标识符代替??
感谢。