How to display the MySQL query?

A

Anonymous

Guest
I have the following coding. How do I display the result after the query has been executed? Thanks.

<?php
$dbconnect=mysql_connect("localhost", "root", "");
mysql_select_db("b2", $dbconnect);
$query=mysql_query("SELECT thread_body FROM b2_threads WHERE forum_id='4' ORDER BY thread_time DESC LIMIT 1");


php?>
 
Code:
while($row=mysql_fetch_assoc($query))
{

echo $row['thread_body'];

}

U may build a table too, by integrating HTML tags.
 
Back
Top