Made $db global

This commit is contained in:
Lars van Hijfte
2017-01-19 11:57:54 +01:00
parent b71cf36798
commit 186cdf1445
14 changed files with 58 additions and 79 deletions

View File

@@ -1,8 +1,7 @@
<?php
require("connect.php");
function selectAllFriends($db, $userID) {
$stmt = $db->prepare("
function selectAllFriends($userID) {
$stmt = $GLOBALS["db"]->prepare("
SELECT
`userID`,
`username`,
@@ -27,5 +26,6 @@ function selectAllFriends($db, $userID) {
$stmt->bindParam(':userID', $userID, PDO::PARAM_INT);
$stmt->execute();
return $stmt;
}