This should be something small and easy to fix but I have been staring at this for too long. I am trying to insert data from a form to a video rental database. The info is being held in a temp dbase until the user wants to rent. All values show if I call them to the next page but I get a die error when I try to insert into the dbase.
Here's the code:
$db_name = "$list";
$table_name = "$tempdbase";
$connection = @mysql_connect("$host", "$username", "$passwrd") or
die("Couldn't connect.");
//works so far
$db = @mysql_select_db($db_name, $connection) or die("Couldn't select database.");
//still good
$sql = "
INSERT INTO $table_name
(id, Title, Genre, Decade, Director, Actor1First, Actor1Last,
Actor2First, Actor2Last, Actor3First, Actor3Last, NewRelease,
Description, ImageName, EmployeeName, OwnersEmail, Rented, RentedEmail, By)
VALUES
(\"id\", \"$Title\", \"$Genre\", \"$Decade\", \"$Director\",
\"$Actor1First\", \"$Actor1Last\", \"$Actor2First\", \"$Actor2Last\",
\"$Actor3First\", \"$Actor3Last\", \"$NewRelease\", \"$Description\",
\"$ImageName\", \"$EmployeeName\", \"$OwnersEmail\", \"$Rented\", \"$Email\",
\"$FName $LName\")
";
$result = @($sql, $connection) or die ("Not executing query");
//This is where I die.
again I think it is something small, but I must be missing it.
Thank you all for your help. It was a syntax error with the varible $By. Sql did not like me using one of it's opperators as a varible. I knew it had to be something small. Thank you for your help!!!