How to connect mysql database using php?

In this article I show you how to php connect with database and access data from it. Before this you know about how to run php files on local computer. If you don’t please read my recent tutorial How to execute PHP files on LOCALHOST using WAMP, MAMP or XAMPP?”

Section -1: Create database & table using “phpmyadmin“

Section -2: Create index.php, conn.php files for database connectivity.

Section -3: Run files on localhost



Section-1: Create database & table using “phpmyadmin “

Step-1.1: Right clicks and chooses phpmyadmin i.e.

How to connect mysql database using php - step-1






Step-1.2: Choose Database and create new database i.e.



Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to Top
%d bloggers like this: