参见英文答案 >
How could I change this mysql to mysqli? 6
因为MYSQL已被弃用,eveyone不断告诉我更新,我以为这是关于我做的时间.
但是因为我不习惯mysqli_ *,对我来说似乎是陌生的.当我在Mysql中编写了一个整个网站时,并不是一个简单的编辑.
所以我想知道如何将以下代码转换为Mysqli?在处理查询数据库时,只要给我和其他人一个好的起点.
$sql_follows="SELECT * FROM friends WHERE user1_id=".$_SESSION['id']." AND status=2 OR user2_id=".$_SESSION['id']." AND status=2";
$query_follows=mysql_query($sql_follows) or die("Error finding friendships");
if($query_follows>0){
}
编辑:阅读和编辑我的整个网站上面的代码转换成MYSQLI_将会这样的东西..
$Your_SQL_query_variable= mysqli_query($connectionvariable,"SELECT * FROM friends WHERE user1_id=".$_SESSION['id']." AND status=2 OR user2_id=".$_SESSION['id']." AND status=2")) {
printf("Error: %s\n", $mysqli->error);
}