Hi,
Can anyone see anything I am doing wrong here, I simply can't get the form results to write to Mysql database - yet I've copied this exactly from another file, which works perfectly.
<?
require_once("book_sc_fns.php");
if ($POST['opt_display'] == "" or $POST['opt_ref'] == "")
{
admin_header();
echo "<FONT FACE='ARIAL' SIZE='1' COLOR='FF0000'> <BR><BR>Error. You did not complete the entire form.<BR>Please try again, thank you.</FONT>";
display_option_form(); //function in store_cat_fns.php file
do_html_footer();
exit;
}
$POST['opt_display'] = addslashes($POST['opt_display']);
$POST['opt_ref'] = addslashes($POST['opt_ref']);
@ $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 options values ('".$POST['opt_display']."', '".$POST['
opt_ref']."')";
$result = mysql_query($query);
if ($result)
admin_header();
echo "<FONT FACE='ARIAL' SIZE='1' COLOR='0000FF'> <BR>Thank you. One new category has been entered into your online database.<BR></FONT>";
display_option_form();
do_html_footer();
?>