<html> <head> <title>Opening a connection and selecting a database</title> </head> <body> <?php $user = "navioo"; $pass = "password"; $db = "navioo"; $link = mysql_connect( "mysql153.secureserver.net", $user, $pass );
if ( ! $link ){ die( "Couldn't connect to MySQL" ); } print "Successfully connected to server<P>"; mysql_select_db( $db ) or die ( "Couldn't open $db: ".mysql_error() ); print "Successfully selected database "$db"<P>"; mysql_close( $link ); ?> </body> </html>
|