Hi Everyone, hows it going?
I'm currently using the following code, inoder to create a table like structure on a page:
.cell
{
left: 0px;
top: 0px;
width: 100px;
height: 100px;
position: relative;
margin-left: 10px;
margin-bottom: 10px;
float: left;
}
how do i display all the first names and last names, stored in the database, inside different boxes, like a table? See below
Code:
<?php
$con = mysql_connect("localhost","peter","abc123");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("my_db", $con);
$result = mysql_query("SELECT * FROM person");
while($row = mysql_fetch_array($result))
{
echo $row['FirstName'] . " " . $row['LastName'];
echo "<br />";
}
mysql_close($con);
?>
| FIRSTNAME | LASTNAME |
| Brian | Tims |
| Stuart | Holmes |
Many Thanks,