prepare($sql); $stmt->execute(); $result = $stmt->setFetchMode(PDO::FETCH_ASSOC); $record = $stmt->fetch(); } catch (PDOException $e) { echo "Error in $from: Not Found"; } return $record; } function isThisBound($pdo, $where, $item_id, $user_id){ $conn = $pdo; try { if($where === "list"){ $item = "beer_id"; }else $item = "brewery_id"; $sql = "SELECT * FROM $where WHERE $item = $item_id AND user_id = $user_id"; $stmt = $conn->prepare($sql); $stmt->execute(); $result = $stmt->setFetchMode(PDO::FETCH_ASSOC); if($stmt->rowCount() == 1)return true; else return false; } catch (PDOException $e) { echo "Error in $where: Not Found"; } }