Hi
First you get the filenames in the directory:
$myDir = opendir("path/to/images/");
then you do something like:
$lastImage = "";
while($entry = readdir($myDir)) {
if($entry != "." && $entry != "..") {
$entry = ereg_replace("_t.jpg", "", $entry);
$entry = ereg_replace(".jpg", "", $entry);
if($entry != $lastImage) {
<store $entry in db>
}
$lastImage = $entry;
}
}
NOTICE: this is not bug-checked, tested or validated in any way. It is furthermore not the most elegant way to solve the problem, but it will get the job done
When you store the imagename you should also make a check, that it doesn't exist allready. Perhaps even make the name unique.
Hope this will help you.
Regards
// Martin