Form Variables Problem (fixed)
Posted: Sat Feb 21, 2004 12:45 pm
I'm trying to use an online form to enter information into a mySQL database. Some of my variables are making it into the database, some of them aren't. Here's my code:
The cosponsor variable is not making it to the database and the attendance always shows up as 0. I've double checked my form code and everything seems to be right there. Any help would be appreciated!
Code: Select all
mysql_connect($DBhost,$DBuser,$DBpass) or die("Unable to connect to database");
@mysql_select_db("$DBName") or die("Unable to select
database $DBName");
$event = htmlspecialchars(addslashes($event));
$date = htmlspecialchars(addslashes($date));
$sponsor = htmlspecialchars(addslashes($sponsor));
$cosponsor = htmlspecialchars(addslashes($cosponsor));
$type = htmlspecialchars(addslashes($type));
$attendance = htmlspecialchars(addslashes($attendance));
$sqlquery = "INSERT INTO $table
VALUES('$event','$date','$sponsor','$cosponsor','type','attendance')";
$results = mysql_query($sqlquery);
mysql_close();