title: Why do I get "Resource id #4" when I apply print_r() to an array in PHP?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/4290108/how-do-i-echo-a-resource-id-6-from-a-mysql-response-in-php">How do i “echo” a “Resource id #6” from a MySql response in PHP?</a>  </p>
  </blockquote>
  
  
  
  <p>Below is the code:</p>
  
  <pre><code>$result=mysql_query("select * from choices where a_id='$taskid'")or die(mysql_error());
  print_r($result);
  </code></pre>
  
  <p>I get "Resource id #4", any idea?</p>
  
  <p>After I added </p>
  
  <pre><code>while($row=mysql_fetch_assoc($result))
  { print_r($row); }
  </code></pre>
  
  <p>I just got <code>[]</code></p>
  
  <p>What's wrong?</p>