Showing posts with label PHP - MYSQL CONNECT. Show all posts
Showing posts with label PHP - MYSQL CONNECT. Show all posts

Close a database connection

If you want to close the mysql database connection by using php then you should write the following command.

mysql_close($con);


Then the code will be,

Create connection to a database

If you want to connect a mysql database by using php then the command will be:
mysql_connect("host_name", "user_name", "password")

In php we can write it by the following way.