Let's see if I can explain friends, I have this query that I have managed to execute correctly thanks to you, I am working on postgreSQL and php, and so my table is built to show on the page in php
<div id="tabs-8" class='panel'>
select distinct no, FOLIO_FAMILIA, ID_MUNINICPIO, ID_LOCALIDAD,
PERROS, CERDOS, VACAS, LOROS
from (
select distinct row_number() OVER (order by e.FOLIO_FAMILIA,
e.ID_MUNICIPIO, e.ID_LOCALIDAD) as No,
e.FOLIO_FAMILIA, e.ID_MUNICIPIO, e.ID_LOCALIDAD,
MAX( case when id_caso=1 then 1 else 0 end) as PERROS,
MAX( case when id_caso=2 then 1 else 0 end) as CERDOS,
MAX( case when id_caso=3 then 1 else 0 end) as VACAS,
MAX( case when id_caso=4 then 1 else 0 end) as LOROS
from encuesta e , bienes b, zona z
where e.FOLIO_FAMILIA = b.FOLIO_FAMILIA
and e.FOLIO_FAMILIA = z.FOLIO
and e.ID_MUNICIPIO = '12-15'
and id_caso in (1,2,3,4) and z.id_zona='12-15-1'
group by e.FOLIO_FAMILIA, e.ID_MUNICIPIO, e.ID_LOCALIDAD
order by e.FOLIO_FAMILIA, e.ID_MUNICIPIO, e.ID_LOCALIDAD) as t1;
$result = pg_query($query) or die('Query failed: ' . pg_last_error());
$rows = pg_num_rows ($result);
$i = pg_num_fields($result);
echo "<table class='table table-fixed' border=1> <tr>";
for($j=0; $j<$i; $j++){
$fieldname=pg_field_name($result, $j);
echo "<th>".strtoupper($fieldname)."</th>";
}
echo "</tr>";
while ($line = pg_fetch_array($result)){
echo "<tr>";
for($j=0; $j<$i; $j++){
if ($line[$j] <> "") {
echo "<td align='left'>$line[$j]</td>";
}
else{
echo"<td align='left'> </td>";
}
}
echo "</tr>";
}
echo "</table>";
?>
</div>
The main function of this table is that the user can see a general analysis regarding the animals, the current result is displayed like this on my page
What I want to achieve is to substitute that one (1) for an image or icon, that is, to have an appearance more or less like this
How can I achieve that, or have some idea of what kind of php code is used to achieve it,
thanks!