This Message Forum is no longer in use

Please use the new Bravenet Help Forums FOUND HERE

General Forum
This Forum is Locked
Author
Comment
I'm having trouble connecting to my database for mailing list

I'm having trouble creating a mailing list. I've created a mailing list form using html. Here's the php code i'm using to send the information to my database.




Transfering Information to Database





$email=$_POST['Email'];
$first_name=$_POST['First_Name'];
$last_name=$_POST['Last_Name'];
$city=$_POST['City'];
$state=$_POST['State'];
$zip=$_POST['Zip'];
$connection=mysql_connect ("sql5.bravehost.com", "casselgraphics", "121182") or die ('I cannot connect to database.');
mysql_select_db ("mailing_list-1531089",$connection) or die( "Unable to select database");
$query = "INSERT INTO 'mailing_list'('ID', 'Email', 'First_Name', 'Last_Name', 'City', 'State', 'Zip') VALUES ('', '$Email', '$First_Name', '$Last_Name', '$City', '$State', '$Zip')";
mysql_query($query);
mysql_close();
?>





and I keep getting a message that it can't connect to database. Please help