如何修复:mysqli_query()期望参数1为mysqli,mysqli_fetch_array()期望参数1为mysqli_result [英] How to fix: mysqli_query() expects parameter 1 to be mysqli and mysqli_fetch_array() expects parameter 1 to be mysqli_result

查看:355
本文介绍了如何修复:mysqli_query()期望参数1为mysqli,mysqli_fetch_array()期望参数1为mysqli_result的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

require_once'db.php';



$ query =SELECT = FROM quotes ORDER by rand()LIMIT 1;



$ result = mysqli_query($ con,$ query);



while($ row = mysqli_fetch_array($ result)){

print(json_encode($ row ['quote']));

}





?>



我尝试过:



我不知道该怎么办,因为我对PHP编码没有经验,急需帮助!

require_once 'db.php';

$query = "SELECT = FROM quotes ORDER By rand() LIMIT 1";

$result = mysqli_query($con, $query);

while($row = mysqli_fetch_array($result)) {
print(json_encode($row['quote']));
}


?>

What I have tried:

I am no sure what to do as i am not experienced with PHP coding, help required URGENTLY!

推荐答案

query =SELECT = FROM quotes ORDER by rand() LIMIT 1;


query = "SELECT = FROM quotes ORDER By rand() LIMIT 1";


result = mysqli_query(
result = mysqli_query(


con,


这篇关于如何修复:mysqli_query()期望参数1为mysqli,mysqli_fetch_array()期望参数1为mysqli_result的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆