<?php
if(ISSET($_POST['fecha'])){
$query = mysqli_query($conn, "SELECT * FROM `fotos` ORDER BY `fecha` DESC") or die(mysqli_error());
//$query = $conn->query("SELECT * FROM `fotos` order by fecha desc") or die(mysqli_errno()); (ORDENA POR FECHA)
while($fetch = mysqli_fetch_array($query)){
echo "<tr>
<td>".$fetch['fecha']."</td>
<td>".$fetch['nombre']."</td>
<td>".$fetch['codigo']."</td>
<td>".$fetch['correo']."</td>
<td>".$fetch['img']."</td>
<td>."<center><img src="<?php echo "upload/".$fetch['img']?>" width="165" height="165">."</center></td>
<td><center><img src="<?php echo "upload/".$fetch['img']?>" width="165" height="165"></center></td>
</tr>";
I want to print the image inside the php, but I don't know how to concatenate the route.
I want to concatenate the route with the image, to be able to visualize it.
while($fetch = mysqli_fetch_array($query)){
echo "<tr>
<td>".$fetch['fecha']."</td>
<td>".$fetch['nombre']."</td>
<td>".$fetch['codigo']."</td>
<td>".$fetch['correo']."</td>
<td>".$fetch['img']."</td>
</tr>";
}
But I want to use this structure:
<td>
<center>
<img src="<?php echo "upload/".$fetch['img']?>" width="165" height="165">
</center>
</td>