1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

I have problem with PHP Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result

Discussion in 'MySQL' started by leutrimraifi, May 24, 2017.

  1. #1
    Please can you help me what i need to do?
    nonstop i have that error on my server

    PHP Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in /var/www/mydomain.com/public_html/includes/db_mysqli.php on line$n line 85, referer: http://m.facebook.com

    Here is db_mysqli.php file

    class Database{
       private $con = false;
      private $conect = "";
       private $result = array();
      private $query = "";
       public function connect(){
           $this->conect = new mysqli( _host, _user, _pass, _base );
      if($this->conect->connect_errno > 0){
      return false;
      $this->con = true;
      return true;
      return true;
      public function close(){
             $this->con = false;
             return true;
             return false;
       public function query($query){
         $query = $this->conect->query($query);
         return $query;
       public function fetch_array($sql){
         $array = mysqli_fetch_array($sql);
         return $array;
       private function tableExists($table){
         $tablesInDb = $this->conect->query('SHOW TABLES FROM '._base.' LIKE "'.$table.'"');
         if($tablesInDb->num_rows == 1){
      return true;
         array_push($this->result,$table." does not exist in this database");
      return false;
       public function num_rows($query)
         return mysqli_num_rows($query);
    Last edited by a moderator: May 24, 2017
    leutrimraifi, May 24, 2017 IP
  2. Blank ™

    Blank ™ Well-Known Member

    Likes Received:
    Best Answers:
    Trophy Points:
    Query is returning false instead of whatever you wanted it to return. Use error reporting (http://php.net/manual/en/mysqli.error.php) to find out why.
    Blank ™, May 24, 2017 IP