Select Database in PHP:

To select a database in PHP first you have to create the database in phpmyadmin and then we select that database in PHP.

So first create a database in phpmyadmin.

Syntax:

mysql_select_db(“database_name”) or die (“Error”);

We created a database named “employee_info” and now in our following example we are selecting that database.

Example:

 

Leave a Reply

Your email address will not be published. Required fields are marked *