Here's the Script I have right now:
Code:
<?php
// CREDITS //
// Blackboy0 for Script //
// 0x0f7afc68 for Total Cash $sql //
$host = "host"; //db host
$user = "username"; // username
$pass = "password"; // password
$don_data = "donordb"; // donator db
$port = 3036; //port
$conn = mysql_connect($host, $user, $pass) or die(mysql_error());
mysql_select_db($don_data, $conn) or die(mysql_error());
$sql = "SELECT COUNT(*) FROM log WHERE entry BETWEEN '1' AND '150'";
$sqlquery = mysql_query($sql) or die(mysql_error());
$don = mysql_result($sqlquery,0,0);
$sql = "SELECT SUM(amount) FROM log";
$sqlquery = mysql_query($sql) or die(mysql_error());
$amount = mysql_result($sqlquery,0,0);
echo "Donations: " . $don . "<br>\n";
echo "Total Cash: $" . $amount . "<br>\n";
mysql_close($conn);
?>
So that shows all Donations and the Total Cash that has been brought in in a simple Format of "____ : ______".
Alright, I wanna do this:
The goal is $15.00, alright? So I want it to update whenever we get a Donation, to say $__.__. So, I was thinking that it like do the SUM thing from before, but then Subtract it from 15.00. I've just started doing this kinda stuff with MySQL PHP, so I dunno all the Commands <_< It'd be great if somebody could help me