I must be doing something wrong here. It doesn't work like it should but its a simple task that serves only one purpose, display the photos from my ./images
and ./thumbnails
folder to my PHP web form. It is not fully finished but I would just like to get the functionality of being able to see my displayed photos on my page.
Image name are the same in both folders, size is different. Here are some sample photo names in the two folders. IMG786_3, IMG3413, IMG31
.
Here is the query to my database in which it retrieves all the title, description, and file name of all photos stored in my database. I put them into an array so I can access them based on an index.
$imgQuery = "SELECT FileName, Title, Description FROM PICTURE WHERE OwnerID='$id' LIMIT 0,7";
if($imgResult = mysqli_query($link, $imgQuery))
{
while($imgRow = mysqli_fetch_row($imgResult))
{
$filename[] = $imgRow[0];
$title[] = $imgRow[1];
$description[] = $imgRow[2];
}
}
Below is the code that is supposed to display these strings of photos from the two folders I have. When I click on a thumbnail, it is suppose to bring that full size image from the ./images
folder and the entire index of the filename, description, and title will change.
print <<<photo
<body>
<span> <?php echo $error; ?> </span>
<form action='MyAlbum.php' method='post'>
<table>
<tr><td colspan='7' ><h2 align='center'>$name's Album</h2></td>
</tr>
<tr><td colspan='7' >$title[$i]</td>
</tr>
<tr><td colspan='5' ><img src="./images/$filename[$i]" /></td><td colspan='2'>$description[$i] </td>
</tr>
<tr>
<td><img src="./thumbnails/$filename[0]" /></td> <td><img src="./thumbnails/$filename[1]" /></td> <td><img src="./thumbnails/$filename[2]" /></td>
<td><img src="./thumbnails/$filename[3]" /></td><td><img src="./thumbnails/$filename[4]" /></td> <td><img src="./thumbnails/$filename[5]" /></td>
<td><img src="./thumbnails/$filename[6]" /></td>
</tr>
</table>
</form>
</body>
</html>
photo;