Hello, and thanks in advance for any help.
Lets say i ran a query to get the auto_id of an article.
each article may or may not contain 1 or more pictures of either jpeg, or gif type.
so if the auto_id of an article is 25. then pictures for the article could be as follows:
25_01.jpg OR 25_01.gif
or
25_01.jpg, 25_02.jpg, 25_03.gif
or Etc. Etc.
basically what i need done is to find all the pictures, whether gif or jpg, that corrospond to the article. and put the names in an array:
example:
// all pictues in the following array corrospond to article 25
$pictures = array(1 => "25_01.jpg", "25_02.gif", "25_03.jpg");
i've been running in circles for a couple of days now.. what is the best way of doing this?
i was thinking something along these lines:
$jpg_ext = ".jpg";
$gif_ext = ".gif";
$pic_count = 1;
$pictures = array ("no_pic.gif");
while (file_exists($auto_id ._. $pic_count . $jpg_ext)) {
array_push($pictures, $auto_id ._. $pic_count . $jpeg_ext);
$pic_count++;
}
while (file_exists($auto_id ._. $pic_count . $gif_ext)) {
array_push($pictures, $auto_id ._. $pic_count . $gif_ext);
$pic_count++;
}
Thanks again.
Mike