prepare($sql); $stmt->execute(); $result = $stmt->setFetchMode(PDO::FETCH_ASSOC); $record = $stmt->fetch(); } catch (PDOException $e) { echo "Error in $from: Not Found"; } return $record; }