prepare($getHitsQuery); $stmt->bindValue(":SID", $id); $stmt->execute(); $hits = $stmt->fetch(PDO::FETCH_COLUMN); return $hits !== false ? $hits : 0; } function addHit($id, $db) { global $setHitsQuery; $stmt = $db->prepare($setHitsQuery); $stmt->bindValue(":SID", $id); $stmt->execute(); }