Your best bet is to use a database table to store the image name along with the id of the game they belong to:
CREATE TABLE Screenshot (
game INT NOT NULL,
filename VARCHAR(100) NOT NULL
);
To query the database to find the filenames for screenshots that belong to a certain game:
PHP Code:
$sql = "SELECT filename FROM Screenshot WHERE game=$id";
$result = mysql_query($sql);
while ($row = mysql_fetch_row($result) {
echo "<p><img scr=\"$row[0]\">";
}
That very crude piece of code demonstrates the idea.
Bookmarks