<?php $user = "root"; $connection = mysql_connect( "localhost", $user, "password" ); if($connection) { $msg="Connected to MySQL, $user"; } else { $msg="Failed"; } ?> <html> <head> <title>MySQL Test</title> </head> <body> <h2> <?php echo("$msg"); ?> </h2> </body> </html>