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 followButton($pdo, $where, $item_id, $user_id){ print_r($pdo); $conn = $pdo; try { $sql = "SELECT * FROM $from WHERE id = $where"; $stmt = $conn->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 showStars($pdo, $beer_id, $user_id){ print_r($pdo); }