It depends on which database you have installed - different databases have different commands within PHP for connection and data retrieval. I'll assume you're using MySQL with PHP.
First, you need to connect to your database:
$mysql_db = mysql_onnect($server_name, $user_name, $user_password);
mysql_select_db($database_name, $mysql_db);
Now that you have a connection, you can start querying your database (simple one to start off with!)
$mysql_qry = "SELECT * FROM table_name";
$mysql_res = mysql_query($mysql_qry, $mysql_db);
An easy way to display all the rows from a table, is to create an HTML table, with each field/attribute within your table displayed in it's own column. Create your table and it's headings on the normal way, then use the following to populate your HTML table:
for ($i=0; $i < mysql_num_rows($mysql_res); $i++) {
$mysql_row = mysql_fetch_row($mysql_res);
printf("<tr>");
for ($j=0; $j < sizeof($mysql_row); $j++) {
printf("<td>%s</td>", $mysql_row[$j]);
}
printf("</tr>\n");
}
The mysql_fetch_row function returns each record within your table as an array, with your first field/attribute starting at zero in your array. The second "for" loop simply uses a counter ($j) to navigate through the array until the end.
I would strongly suggest that you read a book on PHP and MySQL, or use the PHP and MySQL manuals on the Internet to get the basics.