Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7989421
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T12:44:53+00:00 2026-06-04T12:44:53+00:00

In building a website for a friend the database has a row with 39

  • 0

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"];
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T12:44:54+00:00Added an answer on June 4, 2026 at 12:44 pm

    I’m assuming that $propid is what identifies the row itself and that ‘MEDIA_IMAGE_TEXT’ is available in the same row:

    $properties = array();
    while ($row = mysql_fetch_array($sqlSearch)) {
        $propid = $row["propid"];
        $images = array();
        for ($i = 0; $i <= 35; ++$i) {
            $imageId = "MEDIA_IMAGE_" . str_pad($i, 2, '0', STR_PAD_LEFT);
            if ($row[$imageId]) {
                $images[] = array(
                    $row[$imageId],
                    '',
                    '',
                    $row["MEDIA_IMAGE_TEXT_" . str_pad($i, 2, '0', STR_PAD_LEFT)],
                );
            }
        }
        $properties[] = array(
            'id' => $propid,
            'images' => $images,
        );
    
        echo json_encode($properties);
    

    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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm building a website for a friend and it's quite image heavy, I've sliced
My friend and I are building website that allows users to upload images. We
Building a website that has English & Japanese speaking users, with the Japanese users
I am building a website for a not for profit. I had the treasurer
I'm building a website which will show comics. I'd like to store each image
I'm building a website which has a page that users can add content to,
A friend and I are building a fairly complex website based on java. (PHP
I'm building a website which has a feature which ressembles SE's voting system. I'm
I'm building a website for my friend's startup. I'm currently building it on PHP,
I'm building a quick bullshit website for a friend, and I can't figure this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.