警告:mysqli_num_rows()期望参数1为mysqli_result,布尔值为 [英] Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given in

查看:502
本文介绍了警告:mysqli_num_rows()期望参数1为mysqli_result,布尔值为的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<?php

包含'openCon.php';



$ sql =SELECT id,price,table,unitTable,chair,unitChair,lightingFan,unitLightingFan,Decoration,unitDecoration FROM packagea;

$ result = mysqli_query($ conn,$ sql);

if(mysqli_num_rows($ result)> 0){

while($ row = mysqli_fetch_assoc($结果))

{

$ id = $ row ['id'];

$ price = $ row ['price'];

$ table = $ row ['table'];

$ unitTable = $ row ['unitTable'];

$ chair = $ row ['chair'];

$ unitChair = $ row ['unitChair'];

$ lightingFan = $ row ['lightingFan'];

$ unitLightingFan = $ row ['unitLightingFan'];

$ Decoration = $ row ['Decoration'];

$ unitDecoration = $ row ['unitDecoration' ];





echo;

echo;

echo;

echo;

echo;

echo;

echo;

echo;

echo;

echo;







}

< br $> b $ b

}

?>

< td> $ unitLightingFan
Bi​​l 价格 单位 主席 单位 照明&风扇 单元 装饰 单元
$ id $ price $表 $ unitTable $椅 $ unitChair $ lightingFan $ Decoration $ unitDecoration




- >我在这条线上遇到问题= if(mysqli_num_rows($ result)> 0){



我尝试过:



我已经尝试了解决方案的问题,但我尝试一切都没有修复我的错误

解决方案

sql =SELECT id,price,table,unitTable,chair,unitChair,lightingFan,unitLightingFan,Decoration,unitDecoration FROM packagea;


result = mysqli_query(

连接,

<?php
include 'openCon.php' ;

$sql = "SELECT id,price,table,unitTable,chair,unitChair,lightingFan,unitLightingFan,Decoration, unitDecoration FROM packagea";
$result = mysqli_query($conn,$sql) ;
if(mysqli_num_rows($result) > 0) {
while($row = mysqli_fetch_assoc($result))
{
$id = $row['id'];
$price = $row['price'];
$table = $row['table'];
$unitTable = $row['unitTable'];
$chair = $row['chair'];
$unitChair = $row['unitChair'];
$lightingFan = $row['lightingFan'];
$unitLightingFan = $row['unitLightingFan'];
$Decoration = $row['Decoration'];
$unitDecoration = $row['unitDecoration'];


echo "";
echo "";
echo "";
echo "";
echo "";
echo "";
echo "";
echo "";
echo "";
echo "";



}


}
?>

Bil Price Table Unit Chair Unit Lighting & Fan Unit Decoration Unit
$id$price$table$unitTable$Chair$unitChair$lightingFan$unitLightingFan$Decoration$unitDecoration


->I HAVE PROBLEM AT THIS LINE = if(mysqli_num_rows($result) > 0) {

What I have tried:

I HAVE TRY GOOGLE FOR THE SOLUTION BUT EVERYTHING I TRY IT DOESNT FIX MY ERROR

解决方案

sql = "SELECT id,price,table,unitTable,chair,unitChair,lightingFan,unitLightingFan,Decoration, unitDecoration FROM packagea";


result = mysqli_query(


conn,


这篇关于警告:mysqli_num_rows()期望参数1为mysqli_result,布尔值为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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