FireGeek21
Technical User
Hi,
On our fire department website we would like to add a page of pictures of our personnel. I am against adding names of our personnel directly into the html code so I have a mySQL database with their name, position, email address, and image file. I am using php to pull the data out and display it on our page. Here is a draft of the code I have so far:
Right now the data displays one row per person. I am looking to display 4 pictures across with name, position, and email address below each picture. Then, the next row will display the next 4 pictures across with name, position, and email address below each picture, etc...
How can I get the data to display across and then down???
Thanks,
Tammy
FireGeek
(currently using Crystal Reports XI with Lawson 9.01)
On our fire department website we would like to add a page of pictures of our personnel. I am against adding names of our personnel directly into the html code so I have a mySQL database with their name, position, email address, and image file. I am using php to pull the data out and display it on our page. Here is a draft of the code I have so far:
PHP:
CODE --> php
<html>
<body>
<?php
//Get data from database and display in HTML table
$con = mysql_connect("localhost","mukwona2_Mfd3400","1913mfd!");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("mukwona2_contacts", $con);
$result = mysql_query("SELECT * FROM email_address ORDER BY Nbr");
echo "<table>
<tr>
<th>Nbr</th>
<th>LName</th>
<th>FName</th>
<th>Email</th>
<th>Position</th>
<th>Picture</th>
</tr>";
while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['Nbr'] . "</td>";
echo "<td>" . $row['LName'] . "</td>";
echo "<td>" . $row['FName'] . "</td>";
echo "<td>" . $row['Email'] . "</td>";
echo "<td>" . $row['Position'] . "</td>";
echo "<td><img src=" . $row['Headshot'] . " height='200' width='150'></td>";
echo "</tr>";
}
echo "</table>";
mysql_close($con);
?>
</body>
</html>
Right now the data displays one row per person. I am looking to display 4 pictures across with name, position, and email address below each picture. Then, the next row will display the next 4 pictures across with name, position, and email address below each picture, etc...
How can I get the data to display across and then down???
Thanks,
Tammy
FireGeek
(currently using Crystal Reports XI with Lawson 9.01)