The error is "No database selected". However, there is nothing wrong with the name because the database "forms" exists. When I use the "test" database on phpMyAdmin, it works fine but it doesn't work on an identical database of a different name. I say it is identical because I copied the database in phpyMyAdmin so I could be mistaken.
Here is my code:
$con = mysql_connect("localhost");
die('Could not connect: ' . mysql_error());
$sql="INSERT INTO form_results (Name, Email, Subject, Message)
die('Error: ' . mysql_error());
echo "<p>Your record has been successfully added to the database.</p>";