<?php
$serveraddr = "localhost"; // this is the location of your database server - normally localhost
$dbuser = "user"; // this is the username you need to log into your mysql server
$dbpassword = "password"; // this is the password for the user.
$dbname = 'webelec'; // this is the name of the database on the db server
if(!$dbconn = mysql_connect($serveraddr,$dbuser,$dbpassword)) { // connect to the db server
print '<p><strong>ERROR: </strong>Could not connect to db server</p>';
exit;
}
if(!mysql_select_db($dbname)) {
print '<p><strong>ERROR: </strong>Could not connect to db on server</p>';
exit;
}
?>