Initial commit
This commit is contained in:
28
includes/totground.php
Normal file
28
includes/totground.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
$servername = "192.168.0.2";
|
||||
$username = "corey";
|
||||
$password = "41945549";
|
||||
$dbname = "controls";
|
||||
|
||||
// Create connection
|
||||
$conn = new mysqli($servername, $username, $password, $dbname);
|
||||
// Check connection
|
||||
if ($conn->connect_error) {
|
||||
die("Connection failed: " . $conn->connect_error);
|
||||
}
|
||||
$query = "SELECT DISTINCT PREVTONS FROM totaltons";
|
||||
$result=$conn->query($query);
|
||||
$tonsin = 0;
|
||||
if ($result->num_rows > 0) {
|
||||
// output data of each row
|
||||
while($rowtotground = $result->fetch_assoc()) {
|
||||
$tonsin += $rowtotground['PREVTONS'];
|
||||
|
||||
}
|
||||
} else {
|
||||
echo "0 results";
|
||||
}
|
||||
$conn->close();
|
||||
|
||||
?>
|
||||
<?php echo ($tonsin)+0; ?>
|
||||
Reference in New Issue
Block a user