BeWebmaster

PHP/MySQL database connection snippet

Ad

<?php

//Usage: save this file as scr_connection.php and include it where needed.

//Define connection variables
$db_host = ' ';       //Database server LOCATION
$db_name = ' ';       //Database NAME
$db_username = ' ';   //Database USERNAME
$db_password = ' ';   //Database PASSWORD

//Connect to database
$connections = mysql_connect($db_host, $db_username, $db_password) or die ('Unable to connect to the database') ;
mysql_select_db($db_name) or die ('Unable to select database!') ;

?>