PDO Connection — Querying the Database
Demonstrates connecting to the vehicle_log database using PDO and retrieving data from the users table. This establishes the foundational data access pattern for the entire application.
| ID | First Name | Last Name | Email Address | System Role |
|---|---|---|---|---|
| 1 | Admin | Admin | admin@test.com |
Admin |
| 2 | CPT83 | User | cpt283@test.com |
User |
| 3 | John | Doe | john.doe@test.com |
User |
| 4 | Jane | Smith | jane.smith@test.com |
User |
Using the PDO driver ensures cross-database compatibility and provides localized protection against SQL injection through the use of prepared statements and parameter binding.
The users table serves as the primary authentication authority, storing hashed passwords and facilitating role-based access control (RBAC) across administrative and standard user interfaces.