Ok I just had an argument with my Webhosts about this situation. I know how to connect to a database - done it hundreds of times.
BUT I am getting a weird error when I know i should not be getting one! here is the error I am getting verbatim-
"Incorrect database name 'INSERT into comments values ('0','','3','1','help me again','0','','0')' "
Now I have gone through and triple checked, and even had someone else go into my database and confirm that the database name I am using is correct.
Now, I have been on this computer since 8 this morning working on these scripts. It could be me entirely missing something drastic. I asked my webhosts if they were having problems with the mysql servers and they got smart-a$$ with me. So they were no help. Please look over this code and tell me if it is my code-
<?php
session_start();
####################################
Parses the Senate Contact Form
####################################
###################
Include Files
###################
include "file outside of root that includes the database name");
#########################
Connect to Database
#########################
$TableName1 = "comments";
$Link1 = mysql_connect($Host, $User, $Password);
mysql_select_db($DBName, $Link1);
######################
Assign Variables
######################
$comstatus="1";
###############################
Insert Data into Database
###############################
$Query1 = "INSERT into $TableName1 values ('0','$zone','$subject','$comstatus','$comments','0','$time','0')";
#########################################
Check to see if there was a problem
#########################################
IF (mysql_db_query($Query1, $DBName, $Link1)) {
Print ("Success");
}else{
Print (mysql_error());
}
?>