0
I appreciate the help you will offer me. I have tried many things, but now I am not moving forward at all. I managed to put this code but it doesn’t show me any picture.
Up on top of me
$results = $query->fetchAll( PDO::FETCH_ASSOC );
And there on the table it comes like this:
<?php foreach( $results as $row ){
if($row['Codigos'] == 7 && $row['Maquinas'] == 5) {
echo '<img src="/images/'.$photo->t1.png.'"/>';
}
?>
In short... I will have a table with several possibilities, will be 3 columns in the table and the images will change every X minutes and if the value changes in the database, then will change the image inside the table also.
Thank you all again!
And what’s the mistake ?
– Vinicius Shiguemori
var_dump($row['Codigos'])
gives what? andvar_dump($row['Maquinas'])
?– Isac
@Thanks for helping out, so... nothing shows up. If I put only view information it appears, but trying to use this code with the image will not...
– Gabriel
@Isac What values do they bring? Then, there is a gateway installed in a location that brings me information through an IP. These are numbers that update every X minutes. Always numbers...
– Gabriel
is missing close the
foreach
– Vinicius Shiguemori
Only has a number or has the whole ip separated by
.
? It’s likestring
or howint
? All these kinds of details matter and may make a difference to what you’re trying to do– Isac
@Isac In fact I have a separate table that brings this information, so I set up a view that brings only the results. In short, then I have a view only for what I need to "pull". If there is the value 2 in the column "x" and the value 3 in the column "y" then shows the image. Gave to understand?
– Gabriel
If you add any image manually, it appears?
– Márcio Cristian
@Márciocristian Thanks for help :) Yes, I tried to insert normally and it was... <td class="Tg-031e"><img src="images/TELA-MONITOR-USAR_01.png" alt="></td>
– Gabriel
If you can, edit and paste an output of the $photo variable, try using var_dump.
– Márcio Cristian