summaryrefslogtreecommitdiff
path: root/html/includes/functions.php
diff options
context:
space:
mode:
authorMatthijs Kuiper <info@matthijskuiper.nl>2018-01-14 20:08:50 +0100
committerMatthijs Kuiper <info@matthijskuiper.nl>2018-09-01 11:48:28 +0200
commit7e5c50603cbe1307d68a2b5b8ee14409e15a9dcb (patch)
tree0fff0499b4d94f8ed2e13d72bfd97dec51cd283e /html/includes/functions.php
parent4d21dfcac97fd02c186bb3ce4085275b36e3790e (diff)
Update to mysqli
Diffstat (limited to 'html/includes/functions.php')
-rwxr-xr-xhtml/includes/functions.php19
1 files changed, 9 insertions, 10 deletions
diff --git a/html/includes/functions.php b/html/includes/functions.php
index 93614f7..d060edd 100755
--- a/html/includes/functions.php
+++ b/html/includes/functions.php
@@ -1,7 +1,6 @@
<?php
// Connect to database
-mysql_connect($hostname, $uname, $upass);
-mysql_select_db($dbname);
+$GLOBALS["___mysqli_link"] = mysqli_connect($hostname, $uname, $upass, $dbname);
// Error reporting
// error_reporting(E_ALL & ~E_NOTICE);
@@ -115,18 +114,18 @@ function my_fclose($fp, $compression) {
// Small query
function small_query($query) {
- $sql_small = "$query";
- $q_small = mysql_query($sql_small) or die(mysql_error());
- $r_small = mysql_fetch_array($q_small);
- return $r_small;
+ $sql_small = "$query";
+ $q_small = mysqli_query($GLOBALS["___mysqli_link"], $sql_small) or die(mysqli_error($GLOBALS["___mysqli_link"]));
+ $r_small = mysqli_fetch_array($q_small);
+ return $r_small;
}
// Small query count
function small_count($query) {
- $sql_small = "$query";
- $q_small = mysql_query($sql_small) or die(mysql_error());
- $r_small = mysql_num_rows($q_small);
- return $r_small;
+ $sql_small = "$query";
+ $q_small = mysqli_query($GLOBALS["___mysqli_link"], $sql_small) or die(mysqli_error($GLOBALS["___mysqli_link"]));
+ $r_small = mysqli_num_rows($q_small);
+ return $r_small;
}
// uid generator