title: PHP "Expects parameter 1 to be resource, boolean given"
body: <p><strong>I have fixed this, there was a problem in the clean function and a few other little errors, thankyou for all your help.</strong></p>
  
  <p>I seem to have a problem with my PHP Code. I keep getting the errors:  </p>
  
  <blockquote>
    <p><code>Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given</code> 
    <code>Warning: mysql_num_rows() expects parameter 1 to be resource, string given</code>
         
  </blockquote>
  
  <pre><code>        public function __construct() {
              global $db, $core;
  
              $this-&gt;sessionID = $core-&gt;encrypt(session_id());
  
              $sessionQuery = $db-&gt;query("SELECT * FROM sessions WHERE `session_id` = '{$this-&gt;sessionId}'");
              $sessionRow = $db-&gt;assoc($sessionQuery);
  
              if($db-&gt;num($sessionQuery) &gt; 0) {
                  $userQ = $db-&gt;query("SELECT * FROM users WHERE id = '{$sessionRow['user_id']}'");
                  $this-&gt;loggedIn = true;
                  $this-&gt;userData = $db-&gt;assoc($userQ);
              }       
          }       
      }
      $user = new User();
  
  ?&gt;  &lt;br /&gt;&lt;br /&gt;
  </code></pre>
  
  <p><br/><br/></p>