Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

185
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda