| <?php
// database variables
$localhost =
"localhost";
// database
name
$database = "database name";
// username
$db_user = "username";
// password
$db_pass = "password";
// No need to
edit below here
// Now connect
to MySQL database
$result = mysql_pconnect("$localhost",
"$db_user", "$db_pass");
if (!$result)
// If connection
fails then notify
echo"could not connect to database.";
// Now select the database you will use
if (!mysql_select_db("$database"))
// If no database to select then notify
echo"could not select database.";
?>
|