I am attempting to add a custom page to our Drupal Intranet website here at work.
Apologies in advance, as my php and MySQL knowledge is minimal.
It is using PHP to make a query from a staff contact database and generate a page containing staff photos with contact information below each photo.
The code I put together is successfully pulling data from the MySQL Database and I can output it as a single row or a single column on the page.
As written below, the code produces a single row of output as seen in the image below.
<?php
$dbc = mysqli_connect('localhost', 'username', 'password', 'employees_db') or die("Bad Connect: ".mysqli_connect_error());
$sql = "SELECT * FROM Employees ORDER BY fname";
$result = mysqli_query($dbc, $sql) or die("Bad Query: $sql");
echo "<table width='750' border='1'><tr>";
while($row = mysqli_fetch_assoc($result)) {
echo"<td align=left><img align=left width=150 border=0 src=http://192.168.0.230/intranet/pix/employee/{$row['Image']}.jpg><br><b>{$row['fname']} {$row['lname']}</b><br><b>Dept:</b> {$row['Dept']}<br><b>Ext:</b> {$row['Ext']}<br><b>Direct:</b> {$row['Direct']}<br><b>Cell:</b> {$row['Cell']}<br><b>PC<a href='http://192.168.0.228/node/1574' target=center><img src=http://192.168.0.230/intranet/pix/employee/questionmark.jpg border='0'></a>:</b> {$row['PC']}</td>";
}
echo "</tr></table>";
?>
My goal would be to have it look like the picture but output as multiple rows of 4 or 5 employees.
I feel like I am missing something silly. Thanks for the help.