title: PHP var_dump returns reesource(16)
body: <p>I have the following code:</p>
  
  <pre><code>function fetch_conversation_messages($conversation_id){
      $conversation_id = (int)$conversation_id;
  
      $sql = "SELECT
                              `conversations_messages`.`message_date`,
                              `conversations_messages`.`message_date` &gt; `conversations_members`.`conversation_last_view` AS `message_unread`,
                              `conversations_messages`.`message_text`,
                              `users`.`user_name`
                      FROM `conversations_messages`
                      INNER JOIN `users` ON `conversations_messages`.`user_id` = `users`.`user_id`
                      INNER JOIN `conversations_members` ON `conversations_messages`.`conversation_id` = `conversations_members`.`conversation_id`
                      WHERE `conversations_messages`.`conversation_id` = {$conversation_id}
                      AND `conversations_members`.`user_id` = {$_SESSION['user_id']}
                      ORDER BY `conversations_messages`.`message_date` DESC";
  
      $result = mysql_query($sql);
      var_dump($result);
      $messages = array();
  
      while (($row = mysql_fetch_assoc($result)) !== false){
              $messages[] = array(
                      'date'          =&gt; $row['message_date'],
                      'unread'        =&gt; $row['message_unread'],
                      'text'          =&gt; $row['message_text'],
                      'user_name'     =&gt; $row['user_name'],
              );
      }
      var_dump( $messages );
  </code></pre>
  
  <p>}</p>
  
  <p>It should return something like this:</p>
  
  <pre><code>Array ( [0] =&gt; Array ( [date] =&gt; 1322254667 [text] =&gt; one [user_name] =&gt; bob ) )
  </code></pre>
  
  <p>However, it returns</p>
  
  <pre><code>resource(16) of type (mysql result) array(0) { }
  </code></pre>
  
  <p>I am completely new to PHP and MySQL, but I have tried checking for typos, echoing mysql_error, and killing the script at an error, which shows that there is no error in the SQL.</p>
  
  <p>I do not know what has gone wrong and how to fix it.</p>
  
  <p>Please help me. Thanks in advance.</p>