The interactions in this eCourse require Javascript to be enabled.
Creating the Database Access Logic
previous|next
Sheila's team creates the database access logic in a file called hr_db.inc. The hr_db.inc include file declares the following functions:
db_connect() to create and return a database connection
db_do_query() to execute a generic query and return a result set
db_error() to store error information as an array in the session state
The database access layer performs error checking and handling. If an error occurs, the error message is stored as an array structure in the session state of the PHP application. The user interface (UI) functions remove the error information from the session after it displays the error information. Click hr_db.inc to view the complete PHP file.