Simple php script to check database connection

To check the database connection script you can use following code under your domain

<?php
mysql_connect(“localhost”, “admin”, “1admin”) or die(mysql_error());
echo “Connected to MySQL<br />”;
mysql_select_db(“test”) or die(mysql_error());
echo “Connected to Database”;
?>
After browsing the database connection script you will see following content if database connect to your server.

Connected to MySQL
Connected to Database

 

Both comments and pings are currently closed.

Comments are closed.