Browse Source

Update depecrated sql calls, thanks Jeremy :)

pull/12/head
falkTX 6 years ago
parent
commit
208939a111
3 changed files with 10 additions and 10 deletions
  1. +5
    -5
      Donations.php
  2. +3
    -3
      donate/connect.php
  3. +2
    -2
      includes/header.php

+ 5
- 5
Donations.php View File

@@ -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) {
<?php if ($db_link) { ?>
<b>Last 5 donations:</b><br/>
<?php
while ($sql_row = mysql_fetch_assoc($sql_donations_last5)) {
while ($sql_row = mysqli_fetch_assoc($sql_donations_last5)) {
echo "" . date("Y-m-d", strtotime($sql_row["dt"])) . " - " . $sql_row["amount"] . "&euro;<br/>";
}
} ?>


+ 3
- 3
donate/connect.php View File

@@ -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);
}

}


+ 2
- 2
includes/header.php View File

@@ -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"];
}


Loading…
Cancel
Save