Jump to content

PHP Gallery


I-AM-OBODO

Recommended Posts

Hi all,

I don't know if there's a gallery for this already or the right place to ask the question.

User uploads multiple images.

Images are store in a different folder and a unique name stored on the database.

All images have a unique group for referencing purpose .

When a user clicks on a link in his table he can view all images pertaining to a group.

How can i go about that?

What i want to achieve is for example

SELECT ALL FROM IMAGE_TABLE

WHERE USERNAME = USERNAME

AND GROUP_ID = GROUP_ID

Thanks

Link to comment
Share on other sites

2 hours ago, requinix said:

Sounds good so far... Are you having a particular problem?

Yeah. What i currently have can only view the images one after the other by clicking on the back button. But what i am after is to view the images like a gallery where all can be viewed with clicking the back button but by clicking an arrow key to view next or previous image.

 

by code is

	$stmt = $pdo->prepare("
SELECT * FROM  image_table
WHERE post_id = '$_SESSION[post_id]'
AND group_id = '$_SESSION[group_id]'
");
$stmt->execute();
	while($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
    echo '<a href="'.$row['image_path'].'"> View</a>';
    echo "<br>";
}
	

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.