Hello all,
I've run out of gas trying to figure out why this block of code is not writing to the database:
<head>
<title>Book-O-Rama Book Entry Results</title>
</head>
<body>
<h1>Book-O-Rama Book Entry Results</h1>
<?
if( $testfield1 == "" )
{
echo "This is for nothing entered.";
exit;
}
else
{
echo $testfield1;
}
$testfield1 = addslashes($testfield1);
@ $db = mysql_pconnect("localhost", "root", "root");
if (!$db)
{
echo "Error: Could not connect to database. Please try again later.";
exit;
}
mysql_select_db("book_sc");
$query = "INSERT INTO test values ('".$testfield1."')";
$result = mysql_query($query);
if ($result)
echo mysql_affected_rows()." book inserted into database.";
}
?>
</body>