View Single Post
  #4 (permalink)  
Old 01-02-2008, 06:28 PM
jwade_m's Avatar
jwade_m jwade_m is offline
Graphic/Web Designer
 
Join Date: Aug 2007
Location: Indiana, United States
Posts: 196
Default

Look at this one and compair the two:

function connect_db()
{
$DBhost = "servername";//change this line
$DBuser = "****";//change this line "****"
$DBpass = "********";//change this line "********"
$DBName = "nameofdatabase";//change this line ""
$conn = mysql_connect($DBhost , $DBuser, $DBpass,$DBName)
or die("There was a problem connecting to MySQL. Please try again later.");

if (!@mysql_select_db("nameofdatabase", $conn))//change this line ""
{
die ("There was a problem connecting to the database. Please try again later.");
}
return $conn;
}

?>




Notice that he has a variable there for the database name.
Reply With Quote