如何在Mysqli_query中不在Mysql_query中编写预处理语句?
因为我得到了错误 致命错误调用资源上的成员函数prepare()。在prepare()函数的行上。
因为我使用mysql而不是mysqli,我的服务器并没有提供mysqli_query。
这是我的php代码
$con = mysql_connect("dbcom", "d536652", "00", "db652") or die('Unable to Connect');
if( $stmt = $con->prepare("SELECT * FROM db652.users WHERE name = ?"))
{
$stmt->bind_param("s", $name);
$stmt->execute();
$stmt->store_result();
$stmt->bind_result($v1,$v2,$v3,$v4,$v5,$v6,$v7,$v8);
$user=array();
while($stmt->fetch()){
$user[unique_id] = $v2;
$user[name] = $v3;
$user[sheikh] = $v4;
$user[encrypted_password] = $v5;
$user[created_at] = $v7;
$user[updated_at] = $v8;
}
if($password == $user[encrypted_password])
return $user;
} else {
return NULL;