代码在localhost上工作但在服务器上没有

Warning: mysqli_fetch_assoc() expects parameter 1 to be mysqli_result,
boolean given in /home/jungle/public_html/tripcalendar.php on line 39

This is the error I'm getting when running this code but there is no error on localhost.

$tourQuery returns true on localhost but false on live server ?

<?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) {
 ?>

I expect a table of data