diff --git a/Donations.php b/Donations.php index 85f3ca3..508ad8e 100755 --- a/Donations.php +++ b/Donations.php @@ -31,11 +31,11 @@ require "donate/connect.php"; $cur_amount = 0.0; if ($db_link) { -$sql_donations_month = mysql_query("SELECT * FROM donations WHERE MONTH(dt) = MONTH(NOW()) AND YEAR(dt) = YEAR(NOW())"); -$sql_donations_last5 = mysql_query("SELECT * FROM donations ORDER BY dt DESC LIMIT 5"); +$sql_donations_month = mysqli_query($db_link, "SELECT * FROM donations WHERE MONTH(dt) = MONTH(NOW()) AND YEAR(dt) = YEAR(NOW())"); +$sql_donations_last5 = mysqli_query($db_link, "SELECT * FROM donations ORDER BY dt DESC LIMIT 5"); -if (mysql_num_rows($sql_donations_month)) { - while ($sql_row = mysql_fetch_assoc($sql_donations_month)) { +if (mysqli_num_rows($sql_donations_month)) { + while ($sql_row = mysqli_fetch_assoc($sql_donations_month)) { $cur_amount += $sql_row["amount"]; } } @@ -61,7 +61,7 @@ if ($cur_percent > 100.0) { Last 5 donations:
"; } } ?> diff --git a/donate/connect.php b/donate/connect.php index 7b18942..40a40bb 100644 --- a/donate/connect.php +++ b/donate/connect.php @@ -5,11 +5,11 @@ global $db_link; if ($db_hostname) { -$db_link = mysql_connect($db_hostname, $db_user_ro, $db_pass_ro); +$db_link = mysqli_connect($db_hostname, $db_user_ro, $db_pass_ro); if ($db_link) { -mysql_set_charset("utf8"); -mysql_select_db($db_database, $db_link); +mysqli_set_charset($db_link, "utf8"); +mysqli_select_db($db_link, $db_database); } } diff --git a/includes/header.php b/includes/header.php index 9ca95be..95d16dc 100644 --- a/includes/header.php +++ b/includes/header.php @@ -20,9 +20,9 @@ if ($PAGE_TYPE != "PASTE" && $PAGE_TYPE != "DONATIONS" && $PAGE_TYPE != "NAMESPA $cur_percent = 0.0; if ($db_link) { - $sql_donations = mysql_query("SELECT * FROM donations WHERE MONTH(dt) = MONTH(NOW()) AND YEAR(dt) = YEAR(NOW())"); + $sql_donations = mysqli_query($db_link, "SELECT * FROM donations WHERE MONTH(dt) = MONTH(NOW()) AND YEAR(dt) = YEAR(NOW())"); - if (mysql_num_rows($sql_donations)) { + if (mysqli_num_rows($sql_donations)) { while ($sql_row = mysql_fetch_assoc($sql_donations)) { $cur_amount += $sql_row["amount"]; }