CD Collection Hector Urtubia Fall 2002
Summary Motivation and Objective Technologies Used Project Design Database Design and Integration Demo
Motivation and Objective Hands-on project Gain experience on database design Project design and database integration To have a final product that is (somewhat) useful To learn more about SQL
Technologies used Programming Language: – PHP Database Package – MySQL
PHP PHP Hypertext Processor Very popular web scripting language – Embedded into HTML – Fast development cycle Open Source Fairly complete API Extensive database support
MySQL Fast Relational Database Management System Uses SQL as its query language Open Source Multi-platform Interfaces to many languages: PHP, Perl, Java, C, Python
Project Design In short: A database of CD’s. Special features: – CD’s classified by artist and country – Efficient search mechanism – User based User privileges – Ratings system – Interesting Reports based on collected data
Database Design: Main Tables cd_idartist_idnameYeardescripti on date cds artists artists_idnamecountry_iddescription country country_idname
Database Design: User Tables users user_idusernamepassword session_id user_privileges user_id privilege
Database Design: Additional Tables cd_views cd_iduser_iddate cd_ratings cd_iduser_idtextratingdate
User Authentication Client sends username, password pair Server sees if username,password pair match the database. – No: do nothing – Yes: server sets cookie on client with user_id and a randomly chosen session_id. Server also stores the session_id on the DB.
Seeing if a user is logged in Server sees if cookies with the user_id and the session_id are stored on the client If the user_id and session_id cookies match the ones on the DB, then the user is authentic To log out a user, we must only set the session_id to NULL
Future Work Extend the design to make it able to be a CD Shopping Store. Reorganize some of the code and make more object oriented Extend the design so it can not only have CD’s but arbitrary items
DEMO