title: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result
body: <p>I get the error when trying to run this:</p>
  
  <pre><code>&lt;?php
  require_once('includes/DbConnector.php');
  $connector = new DbConnector();
  $result = $connector-&gt;query('SELECT title,content FROM staff_vacancies ORDER BY ordering LIMIT 0,100');
  // Get an array containing the results.
  // Loop for each item in that array
  while ($row = $connector-&gt;fetchArray($result)){
  
  echo $row['title'].'&lt;/h3&gt;';
  echo $row['content'];
  }
  ?&gt;
  </code></pre>
  
  <p>I have a linked file: DbConnector.php:</p>
  
  <pre><code>&lt;?php
  ////////////////////////////////////////////////////////////////////////////////////////
  // Class: DbConnector
  // Purpose: Connect to a database, MySQL version
  ///////////////////////////////////////////////////////////////////////////////////////
  require_once 'SystemComponent.php';
  
  class DbConnector extends SystemComponent {
  
  var $theQuery;
  var $link;
  
  //*** Function: DbConnector, Purpose: Connect to the database ***
  function DbConnector(){
  
      // Load settings from parent class
      $settings = SystemComponent::getSettings();
  
      // Get the main settings from the array we just loaded
      $host = $settings['dbhost'];
      $db = $settings['dbname'];
      $user = $settings['dbusername'];
      $pass = $settings['dbpassword'];
  
      //the settings
      $host = 'localhost';
      $db = 'xxx';
      $user = 'xxx';
      $pass = 'xxx';
  
      // Connect to the database
      $this-&gt;link = mysql_connect($host, $user, $pass);
      mysql_select_db($db);
      register_shutdown_function(array(&amp;$this, 'close'));
  
  }
  
  //*** Function: query, Purpose: Execute a database query ***
  function query($query) {
      $this-&gt;theQuery = $query;
      return mysql_query($query, $this-&gt;link);
  }
  
  //*** Function: getQuery, Purpose: Returns the last database query, for debugging ***
  function getQuery() {
      return $this-&gt;theQuery;
  }
  
  //*** Function: getNumRows, Purpose: Return row count, MySQL version ***
  function getNumRows($result) {
      return mysql_num_rows($result);
  }
  
  //*** Function: fetchArray, Purpose: Get array of query results ***
  function fetchArray($result) {
      return mysql_fetch_array($result);
  }
  
  //*** Function: close, Purpose: Close the connection ***
  function close() {
      mysql_close($this-&gt;link);
  }
  
  
  }
  ?&gt;
  </code></pre>
  
  <p>Does anyone know what the problem is? </p>