title: resource id #4 Why am I getting this?
body: <p>I have a pretty basic forum template I am working on for testing purposes</p>
  
  <p>When I create a topic, and press submit, the proccess updates the database but doesn't output on the screen. Why is this? and Why am I getting a Resource id #4 when I echo the $result from this code below:</p>
  
  <pre><code>&lt;?php
  
  $host="server"; // Host name 
  $username="usernamehere"; // Mysql username 
  $password=""; // Mysql password 
  $db_name="forum"; // Database name 
  $tbl_name="question"; // Table name 
  
  // Connect to server and select databse.
  mysql_connect("$host", "$username", "")or die("cannot connect"); 
  mysql_select_db("$db_name")or die("cannot select DB");
  $sql="SELECT * FROM $tbl_name ORDER BY id DESC";
  // OREDER BY id DESC is order result by descending
  
  $result=mysql_query($sql);
  echo $result;
  ?&gt;
  &lt;html&gt;
  &lt;body&gt;
  &lt;table width="90%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC"&gt;
  &lt;tr&gt;
  &lt;td width="6%" align="center" bgcolor="#E6E6E6"&gt;&lt;strong&gt;#&lt;/strong&gt;&lt;/td&gt;
  &lt;td width="53%" align="center" bgcolor="#E6E6E6"&gt;&lt;strong&gt;Topic&lt;/strong&gt;&lt;/td&gt;
  &lt;td width="15%" align="center" bgcolor="#E6E6E6"&gt;&lt;strong&gt;Views&lt;/strong&gt;&lt;/td&gt;
  &lt;td width="13%" align="center" bgcolor="#E6E6E6"&gt;&lt;strong&gt;Replies&lt;/strong&gt;&lt;/td&gt;
  &lt;td width="13%" align="center" bgcolor="#E6E6E6"&gt;&lt;strong&gt;Date/Time&lt;/strong&gt;&lt;/td&gt;
  &lt;/tr&gt;
  
  &lt;?php
  
  // Start looping table row
  while($rows=mysql_fetch_array($result)){
  ?&gt;
  &lt;tr&gt;
  &lt;td bgcolor="#FFFFFF"&gt;&lt;? echo $rows['id']; ?&gt;&lt;/td&gt;
  &lt;td bgcolor="#FFFFFF"&gt;&lt;a href="view_topic.php?id=&lt;? echo $rows['id']; ?&gt;"&gt;&lt;? echo $rows['topic']; ?&gt;&lt;/a&gt;&lt;BR&gt;&lt;/td&gt;
  &lt;td align="center" bgcolor="#FFFFFF"&gt;&lt;? echo $rows['view']; ?&gt;&lt;/td&gt;
  &lt;td align="center" bgcolor="#FFFFFF"&gt;&lt;? echo $rows['reply']; ?&gt;&lt;/td&gt;
  &lt;td align="center" bgcolor="#FFFFFF"&gt;&lt;? echo $rows['datetime']; ?&gt;&lt;/td&gt;
  &lt;/tr&gt;
  
  &lt;?php
  // Exit looping and close connection 
  }
  mysql_close();
  ?&gt;
  
  &lt;tr&gt;
  &lt;td colspan="5" align="right" bgcolor="#E6E6E6"&gt;&lt;a href="create_topic.php"&gt;&lt;strong&gt;Create New Topic&lt;/strong&gt; &lt;/a&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;/table&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>