Read the manual, it covers it very well: http://php.net/manual/en/function.mysql-query.php
Usually you do something like this:
while ($row = mysql_fetch_assoc($result)) {
echo $row['firstname'];
echo $row['lastname'];
echo $row['address'];
echo $row['age'];
}