Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

184
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda