In building a website for a friend the database has a row with 39 fields for images.
In the field is the name of the image (e.g. “my_image.jpg”) not the image itself (BLOB).
i.e.: image_01, image_02, image_03 and so forth.
I have PHP generating the while loop and getting the information without problems.
I’m trying to get all the images into one array so I can display the pictures from that one row as a gallery.
I hope someone can offer me a way forward as I’ve tried without success.
from while loop:
$MEDIA_IMAGE_00 = $row["MEDIA_IMAGE_00"];
$MEDIA_IMAGE_01 = $row["MEDIA_IMAGE_01"];
$MEDIA_IMAGE_02 = $row["MEDIA_IMAGE_02"];
I need to echo out as
["propimages/$MEDIA_IMAGE_00", "", "", "$MEDIA_IMAGE_TEXT_00"],
["propimages/$MEDIA_IMAGE_01", "", "", "$MEDIA_IMAGE_TEXT_01"],
["propimages/$MEDIA_IMAGE_02", "", "", "$MEDIA_IMAGE_TEXT_02"]
for them to display in a gallery.
EDIT:
while($row = mysql_fetch_array($sqlSearch)){
$propid = $row["propid"];
$MEDIA_IMAGE_00 = $row["MEDIA_IMAGE_00"];
$MEDIA_IMAGE_01 = $row["MEDIA_IMAGE_01"];
$MEDIA_IMAGE_02 = $row["MEDIA_IMAGE_02"];
$MEDIA_IMAGE_33 = $row["MEDIA_IMAGE_33"];
$MEDIA_IMAGE_34 = $row["MEDIA_IMAGE_34"];
$MEDIA_IMAGE_35 = $row["MEDIA_IMAGE_35"];
}
I’m assuming that
$propidis what identifies the row itself and that ‘MEDIA_IMAGE_TEXT’ is available in the same row:It generates a list of properties, each having an id and an array of images; each image comprises the location (I guess) and the title / description.