If I got your question:
Let me explain it by example:
Table = TableName
and Contains fields: Field1, Field2, Field3,...
$query = "select * from TableName where where_condition order FieldName ....
$result = mysql_query($query);
// now you can use mysql_fetch_object() or mysql_fetch_array().
// If you want to use mysql_fetch_object, it works as follows
echo "<table>",
while($data = mysql_fetch_object($result)){
echo <tr><td>$data->Field1</td><td>$data->Field2</td><td>.........</td></tr>";
}
echo "</table>";
// mysql_fetch_array()
echo "<table>";
while($data = mysql_fetch_array(4result)){
echo "<tr><td>$data['Field1']</td><td>$data['Field2']</td><td>......</td></tr>";
}
echo "<table>";
Solomon