form submission

wxdqz

New Member
I'm probably overlooking something dumb here;

I have a form with 3 dropdown lists and an action that points to the following php3 script;

--formscript.php3--

<?php
if ($submit) {
$connection= @mysql_connect ("localhost", "name", "password");
if (!$connection) {
echo( "<P>Unable to connect to " .
"database server at this time.</P>" );
exit();
}

mysql_select_db("dbname", $connection);
if (! @mysql_select_db("westerly_com") ) {
echo( "<P>Unable to locate information " .
"database at this time.</P>" );
exit();
}

$sql= "INSERT INTO AutoInformation ('CarYear', 'CarMake', 'CarModel')
VALUES ($CarYear, $CarMake, $CarModel)";

$result = @mysql_query($sql) or die("Error in
query");
}
?>

When the script runs, it always dies (gives me the error in query message). The form lists are all named correctly (CarYear, CarMake, CarModel). What am I missing?

TIA!
 
Back
Top