I've got this code. It gets the data I want from the database and then outputs it into rows and columns. What I want is to display the actual image itself. Here is the code can anybody help:
<?php
include('../generic/connect.php');
$Link=mysql_connect($Host, $User, $Password);
//set the number of columns
$columns = 5;
$Query = "SELECT * FROM photo_pic WHERE pic_album=('$album')";
$Result=mysql_db_query ($DBName, $Query, $Link);
$count=mysql_num_rows($Result);
print("<p align=\"center\"><font face=\"Arial\" size=\"16pt\"><b>$album Album</b></font></p>");
//we are going to set a new variables called $rows
$rows = ceil($count / $columns);
//to do this display, we will need to run another loop
//this loop will populate an array with all our values
while($Row = mysql_fetch_array($Result)) {
$data[] = $Row['pic_fname'];
}
echo "<TABLE BORDER=0 WIDTH=\"75%\" CELLSPACING=2 CELLPADDING=0 ALIGN=CENTER>\n";
//here we changed the condition to $i < $rows
for($i = 0; $i < $rows; $i++) {
echo "<TR ALIGN=CENTER VALIGN=TOP>\n";
//here will run another loop for the amount of columns
for($j = 0; $j < $columns; $j++) {
if(isset($data[$i + ($j * $rows)])) {
echo "<TD ALIGN=CENTER VALIGN=TOP width=\"100%\">" . data [$i + ($j * $rows)]"</TD>\n";
}
}
echo "</TR>\n";
}
echo "</TABLE>\n";
?>