Create a file called "Conn.php" with the following sample code, this code connects
to the localhost with username (user1), password (password1), database name (test)
<?php
$conn = mysql_connect('localhost','user1','password1');
if(!$conn) die("Failed to connect to database!");
$conencted = mysql_select_db('test', $conn);
if(!$conencted) die("Failed to select database!");
?>
Use this as an include file on the pages where you wants to use the connection for querying the database.
Hope this helps