 |
$notify_email = "david.pascoe@rosacea-research.org";
$DB_Server = "mysql1.hostingfuse.com"; //your MySQL Server
$DB_Username = "rosacea_user"; //your MySQL User Name
$DB_Password = "user101"; //your MySQL Password
$DB_DBName = "rosacea_paypal"; //your MySQL Database Name
//create MySQL connection
$Connect = @mysql_connect($DB_Server, $DB_Username, $DB_Password);
if (!$Connect)
{
$info = mysql_error() . " : " . mysql_errno();
mail ($notify_email,"couldn't connect to mySQL $tx_token","$info");
echo ("Couldn't connect to MySQL: $info");
}
//select database
$Db = @mysql_select_db($DB_DBName, $Connect);
if (!$Db)
{
$info = mysql_error() . " : " . mysql_errno();
mail ($notify_email,"couldn't connect to mySQL $tx_token","$info");
echo(" Couldn't select database: $info");
}
$query_pp_gross = "SELECT round(sum(mc_gross)),count(*) FROM `paypal_payment_info`";
$query_postal_gross = "select round(sum(amount)),count(*) from `postal_donations`";
$pp_result = @mysql_query($query_pp_gross);
if ( !$pp_result ) {
$info = mysql_error() . " : " . mysql_errno();
mail($notify_email, "donate SQL FAIL", "REQUEST=$query_pp_gross\n\n$info");
} else {
$row = mysql_fetch_row($pp_result);
$pp_donations = $row[0];
$pp_num_donations = $row[1];
}
$postal_result = @mysql_query($query_postal_gross);
if ( !$postal_result ) {
$info = mysql_error() . " : " . mysql_errno();
mail($notify_email, "donate SQL FAIL", "REQUEST=$postal_postal_gross\n\n$info");
} else {
$row = mysql_fetch_row($postal_result);
$postal_donations = $row[0];
$gross = $pp_donations + $postal_donations;
$thousands = floor($gross/1000);
$hundreds = $gross - ($thousands*1000);
$displayamount = sprintf("$%d,%03d",$thousands,$hundreds);
$num_postal_donations = $row[1];
$num_donations = $num_postal_donations + $pp_num_donations;
}
?>
|
|
|
2005 |
| |
|
|
| |
|
|
|
|
|
echo "$num_donations";
?>
|
| |
|
|
| |
|
|
|
|
|
echo "$displayamount";
?>
|
|
|
|
|
|