help..when I post a simple form to mysql, I get a blank page
Posted: Sun Jun 30, 2002 11:08 pm
Please help me to look at this code!
<?
if (!$txtname || !$txtaddress || !$txtemail)
{echo "You have not entered all the fields.<br>"
."Please go back and try again";
exit;
}
$txtname = addslashes($txtname);
$txtaddress = addslashes($txtaddress);
$txtemail = addslashes($txtemail);
@ $db = my_sqlpconnect("hostname", "username", "pass");
if (!$db)
{
echo "Error: Could not connect to database. Please try again later.";
exit;
}
mysql_select_db("gossippl_cuppa");
$query = "insert into question values
('".$txtname."','".$txtaddress."','".$txtemail."')";
$result = mysql_query($query);
if ($result)
echo mysql_affected_rows()."book inserted into database.";
?>
I did not receive any error and when I check the database on the server, it did not insert a new record. why didn't it give me any error if it did not work.
<?
if (!$txtname || !$txtaddress || !$txtemail)
{echo "You have not entered all the fields.<br>"
."Please go back and try again";
exit;
}
$txtname = addslashes($txtname);
$txtaddress = addslashes($txtaddress);
$txtemail = addslashes($txtemail);
@ $db = my_sqlpconnect("hostname", "username", "pass");
if (!$db)
{
echo "Error: Could not connect to database. Please try again later.";
exit;
}
mysql_select_db("gossippl_cuppa");
$query = "insert into question values
('".$txtname."','".$txtaddress."','".$txtemail."')";
$result = mysql_query($query);
if ($result)
echo mysql_affected_rows()."book inserted into database.";
?>
I did not receive any error and when I check the database on the server, it did not insert a new record. why didn't it give me any error if it did not work.