the calculation of the column count will break;
EXAMPLE 1:
6 times image "sample1.jpg" wich we want to have displayed in 3 column will give us a column count of 1
EXAMPLE 2:
5 times image "sample2.jpg" also in 3 column will give us a column count of 2
EXAMPLE 3:
Using 5 different images gives us the correct column count
THE PROBLEM SPOTTED:
Column calculation is based on the number of rows return by MySQL. Because we're selecting 6 times the same picture we will only get back one row from the database.
THE SOLUTION ??:
If we're sure the images we're selecting are also existing we could replace $temp_count_img with count($content["image_list"])
but I'm not sure what happens, if one of the selected images is missing ;-(
@Oliver: Is this right ?!? What do I have to keep in mind if I want to change this ?
Speaking about the image-sql-statement:
The current statement uses a lot of "or"s:
Code: Select all
SELECT f_id, f_thumb_preview, f_name, f_thumb_list
FROM phpwcms_file
WHERE (f_id=1 OR f_id=3 OR f_id=3 OR f_id=3 OR f_id=3);
Code: Select all
SELECT f_id, f_thumb_preview, f_name, f_thumb_list
FROM phpwcms_file
WHERE IN (1,2,3,4,5,6);