MySQL Connection Test : mysqli_connect « MySQL Database « PHP






MySQL Connection Test

 
<html>

 <head> 
  <title>MySQL Connection Test</title> 
 </head>

 <body>
  <h2>
   <?php $connection = mysql_connect( "localhost", "root", "" )
   or die( "Sorry - unable to connect to MySQL" );
   echo( "Congratulations - you connected to MySQL" );
   ?>
  </h2>
 </body>

</html>
  
  








Related examples in the same category

1.In PHP 5 using the MySQLi extension
2.Discovering Which Extension Is Being Used
3.function mysql_connect() establishes an initial connection with the MySQL server.
4.custom-error-messages.php