How to Connect to a database using php and MySQL?
To connect to a database in php has following requirements:
1. MySQL Database database
2. MySQL Table
When these requirements are completed you are ready to go and you can connect to database.
Now move towards the Code part:
$connect = mysqli_connect('localhost','db_username','db_password','database_name');
This statement will make connection to the database and create an reference object connect,which will be further used to run queries in php.
This is it !!
You have successfully made a connection with database using php !!
Thank you !!