Develop a centralized database connection file using mysqli to handle all database interactions securely across the project. This file will ensure consistent and secure connections to the database, with support for error handling and prepared statements.
Steps to Complete:
Create a db.php file that establishes a secure connection to the MySQL database using mysqli
Configure the connection to handle errors appropriately (e.g., using exceptions).
Use prepared statements for all database queries to prevent SQL injection.
Acceptance Criteria:
A secure, reusable database connection is established using mysqli.
All database interactions in the project use the centralized connection file.
Develop a centralized database connection file using mysqli to handle all database interactions securely across the project. This file will ensure consistent and secure connections to the database, with support for error handling and prepared statements.
Steps to Complete:
Create a db.php file that establishes a secure connection to the MySQL database using mysqli Configure the connection to handle errors appropriately (e.g., using exceptions). Use prepared statements for all database queries to prevent SQL injection. Acceptance Criteria:
A secure, reusable database connection is established using mysqli. All database interactions in the project use the centralized connection file.