Hi All,
Hope everyone had a safe and happy New Year, I am still having trouble
getting an insert data form to work. Below is the code. I was also wondering
if anyone could tell me the PHP Configuration settings necessary to allow a
form to insert data into a MySQL database.
To view this page, http://www.airforcemuseum.com/newentry.htm
Test Form Entry Results
Entry Results
"
."Please go back and try again.";
exit;
}
$firstName = addslashes($firstName);
$lastName = addslashes($lastName);
$dbcnx = @mysql_pconnect("localhost", "username", "password");
if ($db)
{
echo "ERROR: Could not connect to database. Please try again later,";
exit;
}
mysql_select_db("testform");
$query = "insert into testform values
('".$firstName."', '".$lastName."')";
$result = mysql_query($query);
if ($result)
echo mysql_affected_rows()." record inserted into database.";
?>
Thanks in advance,
Ed Waite
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php