the sql was wrong for this

This commit is contained in:
mcguirepr89
2022-02-08 20:38:33 -05:00
parent 5730a6d06d
commit 1deb1255ea
+6 -4
View File
@@ -31,10 +31,12 @@ $sql3 = "SELECT COUNT(*) AS 'Total' FROM detections
AND Time >= DATE_SUB(NOW(),INTERVAL 1 HOUR)"; AND Time >= DATE_SUB(NOW(),INTERVAL 1 HOUR)";
$lasthourcount = $mysqli->query($sql3); $lasthourcount = $mysqli->query($sql3);
$sql4 = "SELECT COUNT(Com_Name) AS 'Total' $sql4 = "SELECT Com_Name
FROM detections FROM detections
WHERE Date = CURDATE()"; WHERE Date = CURDATE()
$speciescount = $mysqli->query($sql4); GROUP BY Com_Name";
$specieslist = $mysqli->query($sql4);
$speciescount = mysqli_num_rows($specieslist);
$mysqli->close(); $mysqli->close();
?> ?>
@@ -110,7 +112,7 @@ while($rows=$mostrecent ->fetch_assoc())
<table> <table>
<tr> <tr>
<th>Species Detected Today</th> <th>Species Detected Today</th>
<td><?php while ($row = $speciescount->fetch_assoc()) { echo $row['Total']; };?></td> <td><?php echo $speciescount;?></td>
</tr> </tr>
</table> </table>
</div> </div>