-1

After I replaced my project on my new pc it says

mysqli_fetch_array()expects parameter 1 to be mysqli_result boolean given in

This is the code

 <?php include('cpanel/databaseconnection.php');?>
     <div class="container-fiulde">
    <header class="header-login-signup">
    <div class="header-limiter">
    <h1><a href="index.php">Afg<span>Bano</span></a></h1>
        <nav>
        <ul>
        <?php 
            $qpage = "select id,name from category";
           $page_query = mysqli_query($databaseconnection,$qpage);
          while ($tittle = mysqli_fetch_array($page_query))
           {?>
        <li class="select"> <a href="<?php echo  
         "show.php?id=".$tittle['id'] ?>"> 
          <?php echo $tittle ['name'];?></a></li>
              <?php }
              ?>
                    </nav>
                <ul>
        <li><a href="admin/login.php">Login</a></li>
        </ul>
        </ul>
            </div>
         </header>
        </div>
       </div>
S.I.
  • 3,250
  • 12
  • 48
  • 77
  • 11
    Possible duplicate of [mysqli\_fetch\_array()/mysqli\_fetch\_assoc()/mysqli\_fetch\_row() expects parameter 1 to be resource or mysqli\_result, boolean given](http://stackoverflow.com/questions/2973202/mysqli-fetch-array-mysqli-fetch-assoc-mysqli-fetch-row-expects-parameter-1) – S.I. Nov 08 '16 at 05:37

1 Answers1

-1

Your query is failing and return false. To see why

if (!$qpage) {
    printf("Error: %s\n", mysqli_error($databaseconnection));
    exit();
}

Also you have typo here. You have extra space after $tittle.

<?php echo $tittle ['name'];?>

Should be

<?php echo $tittle['name'];?>
S.I.
  • 3,250
  • 12
  • 48
  • 77
  • it says "Error: Table 'bnews.home' doesn't exist in engine " but the folder is alredy in the dir xampp/mysql/databnews – Abdullah Eraj Khakyar Nov 12 '16 at 16:50
  • There is no table bnews.home... Is this table to which you trying to connect whit databaseconnection.php? If yes can you show what you have in this file.. – S.I. Nov 13 '16 at 06:26
  • @AbdullahErajKhakyar show the content of `databaseconnection.php` – S.I. Nov 14 '16 at 07:28
  • @AbdullahErajKhakyar then I believe you have another query before this one.. which make query to `bnew.home`? – S.I. Nov 17 '16 at 05:02