Good afternoon, I'm trying to make a table in HTML using PHP to establish communication with the database, the query is as follows
$query1="SELECT b.nombreforense, b.apelldoforense, COUNT(*) AS Total
FROM fallecido AS a
INNER JOIN forense AS b ON(a.forense_idforense = b.idforense)
GROUP BY b.nombreforense,b.apelldoforense ORDER BY Total";
The code used in php is as follows:
<body>
<?php
if(!$records1)
{
echo"Existe algun error. \n";
exit;
}
echo "<table border=1px solid black>";
echo "<th>Nombre y Apellido Forense </th><th>Casos Atendidos</th>";
while ($row1=pg_fetch_array($records1))
{
echo "<tr>";
echo "<td align='center'>".$row1['nombreforense']." ".$row1['apelldoforense']."</td>"."<td>".$row1[Total]."</td>";
echo"</tr>";
}
echo "</table>";
?>
</body>
The problem is that if you bring the data of the attributes "nombreforense" and "apelldoforense" the data of the total that is obtained through the COUNT (*) does not do what it shows is the following
I need to be able to show the cases attended and I do not know what the error is or what is missing in the code