title: Warning: mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, array given in
body: <p>I am getting this error "Warning: mysqli_fetch_assoc() expects parameter 1 to be mysqli_result, array given in" out of code snippet
  "searchcar.php"</p>
  
  <pre><code>$modelmake = $_POST['model_make'];
  $result = $db-&gt;select('car_information','*', 'Model_Make LIKE \'%$modelmake%\''); 
  while($row = mysqli_fetch_assoc($result))
  {
      echo 'Model'.$row['model_make'];
  }
  </code></pre>
  
  <p>here is code snippet from "database.php" the select function</p>
  
  <pre><code> public function select(
          $table,
          $fields = '*',
          $where = '1=1',
          $order = '',
          $limit = '',
          $desc = false,
          $limitBegin = 0,
          $groupby = null,
          $monitoring = false
      ) //monitoring is set to true to view the actual query
      {
  //  $query ='SELECT ' . $fields . ' FROM ' . $table ;
      $query = 'SELECT ' . $fields . ' FROM ' . $table . ' WHERE ' . $where;
  
          if (!empty($groupby)) {
              $query .= ' GROUP BY ' . $groupby;
          }
  
          if (!empty($order)) 
          {
              $query .= ' ORDER BY ' . $order;
  
              if ($desc) 
              {
                  $query .= ' DESC';
              }
          }
  
          if (!empty($limit))
          {
              $query .= ' LIMIT ' . $limitBegin . ', ' . $limit;
          }
  
          $result = $this-&gt;_sendQuery($query);
  
          $resultArray = array();
  
          while ($row = mysqli_fetch_assoc($result)) 
          {
              $resultArray[] = $row;
          }
  
          if ($monitoring) 
          {       
              // If monitoring is activated, echo the query
              echo $query;
          }
          return $resultArray;
      }    
  </code></pre>
  
  <p>I want to use this line "while($row = mysqli_fetch_assoc($result))"
  Please advice!</p>