src/NGB/Db/MySQLy/MySQL.php
public function fetch_all( $query = null ) {
		
		if ( null === $query && null === $this->stmt ) {
			throw new \Exception( 'null === $result && null === $this->stmt' );
		}
		
		$array = [];
		
		if( null !== $query ) {
			
			$result = $this->query($query);
			
			foreach ( $result as $row ) {
				$array[] = $row;
			}
			
// 			while( $row = $result->fetch_assoc() ) {
// 				$array[] = $row;
// 			}
			
			$result->free();
			
			return $array;
		}
		
		
		$this->stmt->store_result();
        
		
		$variables = [];
		$data = [];
		$meta = $this->stmt->result_metadata();

		while( $field = $meta->fetch_field() ) {
			$variables[] = &$data[$field->name]; // pass by reference
		}
    
		call_user_func_array(array($this->stmt, 'bind_result'), $variables);

		$i=0;
		while( $this->stmt->fetch() ) {
			$array[$i] = [];
			foreach( $data as $k=>$v ) {
				$array[$i][$k] = $v;
		    }
		
			$i++;
		    
			// don't know why, but when I tried $array[] = $data, I got the same one result in all rows
		}
		
		$this->stmt->free_result();
		$this->stmt->close();
		
		return $array;
		
	}
public function fetch_all( $query = null ) {
		
		if ( null === $query && null === $this->stmt ) {
			throw new \Exception( 'null === $result && null === $this->stmt' );
		}
		
		$array = [];
		
		if( null !== $query ) {
			
			$result = $this->query($query);
			
			foreach ( $result as $row ) {
				$array[] = $row;
			}
			
// 			while( $row = $result->fetch_assoc() ) {
// 				$array[] = $row;
// 			}
			
			$result->free();
			
			return $array;
		}
		
		
		$this->stmt->store_result();
        
		
		$variables = [];
		$data = [];
		$meta = $this->stmt->result_metadata();

		while( $field = $meta->fetch_field() ) {
			$variables[] = &$data[$field->name]; // pass by reference
		}
    
		call_user_func_array(array($this->stmt, 'bind_result'), $variables);

		$i=0;
		while( $this->stmt->fetch() ) {
			$array[$i] = [];
			foreach( $data as $k=>$v ) {
				$array[$i][$k] = $v;
		    }
		
			$i++;
		    
			// don't know why, but when I tried $array[] = $data, I got the same one result in all rows
		}
		
		$this->stmt->free_result();
		$this->stmt->close();
		
		return $array;
		
	}
http://php.net/manual/en/mysqli-stmt.bind-result.php#102179

@param string $query
@throws \Exception
@return array