Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

183
Views
How to retrieve images after clicking thumbnail from a repeat region using Mysql and PHP

I need some help, I have a repeat region which displays pics from a database, when I click on the image I would like to go to another page where there is a photo gallery to display my pictures bigger.

My problem, no matter which thumb I click I get the same set of pictures from the database, which is usually the last thumb listed.

I am new to php, so i am wondering if anyone can help me, thank you.

Code for thumb page `

<?php do { ?>
 <div class="display-property-pic">

<input type="image" id="imageIn1" src="upload/images/<?php echo $row_repeatRegion['thumb']; ?>" alt="Submit" width="100" height="100" ><input name="picHid" type="hidden" value="<?php echo $row_repeatRegion['property_pic1']; ?>"> 
            </div>
<?php } while ($row_repeatRegion = mysqli_fetch_assoc($repeatRegion)); ?>

`

Code for Gallery page

if(isset($_POST['picHid'])){
    $pic = $_POST['picHid'];
}

mysqli_select_db($wiplisttest, $database_wiplisttest);
$query_getPics = "SELECT photos.photo_id, photos.pic1, photos.pic2, photos.pic3 FROM photos WHERE photos.property_pic1 LIKE '%$pic%'";
$getPics = mysqli_query($wiplisttest, $query_getPics) or die(mysql_error($wiplisttest));
$row_getPics = mysqli_fetch_assoc($getPics);
$totalRows_getPics = mysqli_num_rows($getPics);

    <div class="album">
       <div class="description">fixed images</div>
        <ol>
        <?php do { ?>
        <li>
            <h4><?php echo "Pic"." ".$row_getPics['pic3']; ?></h4>
            <div class="description">Salzburg, Austria</div>
            <a href="upload/images/<?php echo $row_getPics['pic3']; ?>">
            <img src="upload/images/<?php echo $row_getPics['pic2']; ?>" />
            </a>
        </li>
           <?php } while ($row_getPics = mysqli_fetch_assoc($getPics)); ?>
        </ol>
    </div>
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

As you have stored images info in database, there should be id assigned to each image, so when you click on any specific image, get id of that image and retrieve that image on another page using the id.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!