if ($add) {
if (!$submit) //no submission yet, so offer form:
{
?>
Enter Title Info:
}
else
{
//open database connection to book
include '/home/account/MySQLconnections/books2.php';
//escape any quotemarks
$title = addslashes($title);
//trim any whitespace
$title = trim($title);
$year = trim($year);
//insert data into the “title” table:
$query = "INSERT INTO title (title_id, title_name, title_year, title_ts)
VALUES('0', '$title', '$year', NOW())";
$result = mysql_query($query) or die("Error in: $query");
print "
Update successful.
";
}
?>