0

Here elow is my query.Its working fine on my local server but when I push it on live server it give me error as

"Warning: mysqli_query() expects parameter 1 to be mysqli, boolean given in /home/softlogics/public_html/development.php on line 5"

Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, null given in /home/softlogics/public_html/development.php on line 6

Here below is my piece of code

<ul id="top-menu" class="nav navbar-nav navbar-right mu-main-nav">
<?php
  $menu = "SELECT * FROM `menu` WHERE page = '' OR page = 
  'development' AND block = '0' ";
   $result = mysqli_query($conn, $menu);
   while ($row = mysqli_fetch_array($result)) {
   ?>
   <li><a href="#<?php echo $row['section_id'];?>"><?php echo 
   $row['name'];?></a></li>
   <?php
   }
   ?>
   <li><a class="mu-orange-btn" href="training.php">Training</a></li>
   </ul> 

Thanks in advance for any assistance.

Community
  • 1
  • 1
ali gohar
  • 1
  • 2

1 Answers1

-2

you can print error from sql statement by using

<?php 
     mysqli_query($conn, $menu) or die("Error description: " . mysqli_error($conn));
 ?>
Pritamkumar
  • 680
  • 1
  • 10
  • 27