well you could also use mysql_fetch_array and to this, not sure if this is too simple for what you want, but you aren't explaining yourself real well
<?
$conn = mysql_connect("localhost", "username", "password");
$db = mysql_select_db("databasename");
$query = "select * from tablename;";
$result = mysql_query($query) or die(mysql_error());
while ($row = mysql_fetch_array($result))
{
echo $row['fieldname'] . "<br>";
}
?>