Php代码给出了关于mysqli

Php代码给出了关于mysqli

本文介绍了Php代码给出了关于mysqli_result的错误......?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<?php

//这里已经完成了与数据库的连接,但是已经把它遗漏了

//航班

$ sql =SELECT f.Flight_no,fi.DepartureDate ..(有太多的行要添加,所以在这里留下这个)

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



if(mysqli_num_rows($ result)> 0)#5



{

if(strcmp($ _ GET ['optradio'],oneway)== 0)-----问题

{

echo(

航班

);

}



我的尝试:



我已经在此代码之前完成了数据库连接,所有工作都在这里工作。问题出现在第5行。显示代码运行时出现的错误是警告:mysqli_num_rows( )期望参数1为mysqli_result,在家中给出布尔值/ .....

我看过网上并尝试了很多方法来修复它但没有任何工作。任何可能出错的解释?

<?php
//Have done the connections to the db here but have left it out
//flights
$sql = "SELECT f.Flight_no, fi.DepartureDate..(there are too many rows to add so left this out here)
$result = mysqli_query($link,$sql);

if (mysqli_num_rows($result)>0) #5

{
if(strcmp($_GET['optradio'],"oneway")==0) ----- problem
{
echo("

Flights

");
}

What I have tried:

I have already done the database connection before this code and everything up until here works. The problem occurs on line 5. The error that shows when the code has been run is Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given in home/.....
I've looked online and attempted many ways of fixing it but nothing is working. Any explanation of what could be wrong?

推荐答案




这篇关于Php代码给出了关于mysqli_result的错误......?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-16 03:59