1
I would like to know how to display the first image of my Mysql table?
I used a dynamic input file, so I can have several names saved in a single table that in this case is the image. However, I would like to know how I display only the first?
The names in the comic are separated by ;
<div class="lista-prod col-lg-12 ">
<?php
$verificaQuery = mysqli_query($conexao,"select * from produtos");
$verificaRow = mysqli_num_rows($verificaQuery);
if ($verificaCount = 0) {
} else {
$contProd=0;
while ($contSql = mysqli_fetch_array($verificaQuery)) {
$contProd++;
?>
<div class="row mt-5">
<div class="col-lg-4">
<img src="../imagens/produtos/<?php echo $contSql['imagem']; ?>" style="width:100%;">
</div>
If I register only one image it appears normally, but if I register more, it disappears. To summarize, I have a products page, the first image is the one that gets sample if the person opens the product, displays the other photos beside, as I control it?
<?php echo explode(';', $contSql['imagem'])[0]; ?>
– thiagoalessio
Perfect, it was just that, thank you Thiago
– Douglas Lima