> For the complete documentation index, see [llms.txt](https://suyashs-organization-3.gitbook.io/csitlabs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://suyashs-organization-3.gitbook.io/csitlabs/5th_semester/web_technology/class_codes/php/db.md).

# Database connection using PHP and MySQL

## Steps to connect to MySQL database using PHP

1. Create a database in MySQL
2. Create a table in the database
3. Create a PHP file to connect to the database
4. Create a PHP file to insert data into the table
5. Create a PHP file to display the data from the table
