From ca7c38d4881eab384f7fa3b08ec2e0fbc8834d65 Mon Sep 17 00:00:00 2001 From: aftercase <74765798+aftercase@users.noreply.github.com> Date: Tue, 13 Jul 2021 00:28:44 +0100 Subject: [PATCH] Function Fixes Would help if I didn't somehow hit ctrl Z and delete what I just edited. --- includes/functions.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/includes/functions.php b/includes/functions.php index 0d250f3..998ba5e 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -33,11 +33,12 @@ function getUserFavs($conn, $username) { } function CountPasteFavs($conn, $fav_id) { - $query = intval($conn->prepare("SELECT COUNT(f_paste) FROM pins WHERE f_paste=?"))->fetch(PDO::FETCH_NUM)[0]); +$query = intval($conn->prepare("SELECT COUNT(f_paste) FROM pins WHERE f_paste=?")->fetch(PDO::FETCH_NUM)[0]); $query->execute([$fav_id]); return $query->fetchAll(); } + //Can't seem to get working. function checkFavorite($conn,$paste_id, $user_id) { $result = $conn->query("SELECT * FROM pins WHERE m_fav = ? AND f_paste = ?");