We will use this table as an example data set:
Database Name: friends
-----------------------------
| firstname || lastname |
----------------------------
|Chris || Geizz |
|Steve || Michalson |
|Ken || Bohlin |
|Doug || Renard |
-----------------------------
First you must connect to your database as so:
http://www.w3schools.com/PHP/php_mysql_connect.asp
You would run a MYSQL query to get the data from the MySQL Database:
$query = mysql_query("SELECT * FROM friends");
Then you would use the following to put them into a table:
echo "<table><tr><td>First Name</td><td>Last Name</td></tr>";
while($row = mysql_fetch_array($query))
{
echo "<tr><td>";
echo $row['firstname'];
echo "</td><td>";
echo $row['lastname'];
echo "</td></tr>";
}
echo "</table>";
What this basically does is pulls the information that is returned with my mysql_query and puts it into an array that you can call with the $row variable we set. We do this in the while loop so that it repeats for all records in your database.
The code before the while loop and after the while loop are there so that way it is all in one table and we are just making rows instead of separate tables for each row in your database.
This will accomplish what you want. When you are doing the while loop you can use the variables ($row['firstname'] and $row['lastname']) as you wish. You could place them in seperate DIV's if you wish as well.
Hope this helps you! If you have any questions leave a comment and I will respond.