Switch to PHP Data Object (PDO) to handle access to the SQL database. Clean up the code and added the choice for the Hasse Diagram.