<?php
$sql = "SELECT * FROM `YourTable`";
$getyourdata = mysql_query($sql, $connectionHandle) or die(mysql_error());
//check to see if there is anything in your table first
if (mysql_num_rows($getyourdata) > 0){
//display your data here
while($result = mysql_fetch_array($getyourdata)){
//loop through data and display as you wish - this is just an example
echo $result['FirstColumn']." ".$result['SecondColumn']." ".$result['ThirdColumn']."\n\r";
}
}
else{
//display a suitable error
echo "No results returned";
}
?>
There are a few ways of doing this type of thing, but using fetch_array returns your data in both formats: "mysql_fetch_array — Fetch a result row as an associative array, a numeric array, or both" <- quote from the manual.
I prefer to use fetch_object() as this only returns the data as the column names, so essentially this *should* mean less overhead when retrieving data from the database as there is no duplication of data - though people may argue the toss there.
WRT displaying in HTML, you can either use block echo's (difficult to maintain/edit) or you can drop in and out of php, which may look untidy, but is A LOT easier to maintain, and you don't need to escape chars to get the page displayed correctly either, but if your not concerned about W3C validation, that up to you.
There is another way of displaying blocks of html without dipping in and out, called 'here documnet', check out
this [php.net] to get a better understanding of it (about a 3rd of the way down the page).
Any issues, post a message, and the good people of the forum will try to help.
Have fun, and enjoy your coding/programming.
Cheers,
MRb