代码可在localhost上运行,但不能在服务器上运行

时间:2019-05-01 06:19:09

标签: php sql

  

警告:mysqli_fetch_assoc()期望参数1为mysqli_result,
  在第39行的/home/jungle/public_html/tripcalendar.php中给出的布尔值

这是我在运行此代码时遇到的错误,但是在本地主机上没有错误。

$tourQuery在本地主机上返回true,但在实时服务器上返回false?

<?php
        $tourQuery = mysqli_query($con,"SELECT to_startdate,to_enddate FROM tour WHERE  to_name !='' AND to_startdate !='0000-00-00' AND to_deactivated !=1 GROUP BY MONTH(to_startdate),YEAR(to_startdate) ORDER BY to_startdate");

        while ($tourGroup = mysqli_fetch_assoc($tourQuery)){
                 $Date = $tourGroup['to_startdate'];

            $query = "SELECT to_id,to_startdate,to_enddate,price,to_name,child_cat FROM tour WHERE to_name !='' AND to_startdate !='0000-00-00' AND suid = 2 AND to_deactivated !=1 AND ( YEAR(to_startdate)+'-'+ MONTH(to_startdate) = YEAR('".$Date."')+'-'+ MONTH('".$Date."') ) ORDER BY to_startdate";

            $Query = mysqli_query($con, $query);
            if(mysqli_num_rows($Query) > 0) {
 ?>

我希望有一个数据表

0 个答案:

没有答案