From 7c8620ff5f257fb9ff76af6031d197220e3795f8 Mon Sep 17 00:00:00 2001 From: Patrick McGuire Date: Thu, 14 Oct 2021 09:33:42 -0400 Subject: [PATCH] better dbview --- scripts/viewdb.php | 158 ++++++++++++++++++++++++++++++++------------- 1 file changed, 114 insertions(+), 44 deletions(-) diff --git a/scripts/viewdb.php b/scripts/viewdb.php index 32180b2..be7cb55 100644 --- a/scripts/viewdb.php +++ b/scripts/viewdb.php @@ -1,45 +1,115 @@ - - - 'birds' database 'detections' table - - - connect_errno ) { - printf("Connect failed: %s
", $mysqli->connect_error); - exit(); - } - printf('Connected successfully.
'); - - $sql = 'SELECT * FROM detections'; - - $result = $mysqli->query($sql); - - if ($result->num_rows > 0) { - while($row = $result->fetch_assoc()) { - printf("Date: %s || Time: %s || Sci_Name: %s || Com_Name: %s || Confidence: %s || Lat: %s || Lon: %s || Cutoff: %s || Week: %s || Sens: %s || Overlap: %s
", - $row["Date"], - $row["Time"], - $row["Sci_Name"], - $row["Com_Name"], - $row["Confidence"], - $row["Lat"], - $row["Lon"], - $row["Cutoff"], - $row["Week"], - $row["Sens"], - $row["Overlap"]); - } - } else { - printf('No record found.
'); - } - mysqli_free_result($result); - $mysqli->close(); - ?> - +connect_error) { + die('Connect Error (' . + $mysqli->connect_errno . ') '. + $mysqli->connect_error); +} + +// SQL query to select data from database +$sql = "SELECT * FROM detections"; +$result = $mysqli->query($sql); +$mysqli->close(); +?> + + + + + + + Birds Database, Detections Table + + + + + +
+

BirdsDB Detections Table

+ + + + + + + + + + + + + + + + +fetch_assoc()) +{ +?> + + + + + + + + + + + + + + + +
DateTimeSci_NameCom_NameConfidenceLatLonCutoffWeekSensOverlap
+
+ + +