I am trying to create a products page in a admin panel, where the administrator can input their products. I am trying to add the product to the database and use a or die output if anything goes wrong. But it seems like every time I type in or die, I receive a error code before evening running the code (last part of code).
What is the reason for this? Please help.
<?php
// parse from data
if (isset($_POST['product_name'])) {
$pid = mysql_real_escape_string($_POST['thisID']);
$Product_Name = mysql_real_escape_string($_POST['Product_Name']);
$desc = mysql_real_escape_string($_POST['Product_Desc']);
// See if that product name is an identical match to another product in the system
$sql = mysql_query("UPDATE products SET product_name='$Product_Name'LIMIT 1");
$productMatch= mysql_mum_rows($sql);
if ($productMatch>0){
echo "Sorry you tried to place a duplicate product name";
exit();
}
//add products to database
$sql = mysql_query("INSERT INTO Product(Product_Name,Product_Desc,date_added)
VALUES('$Product_Name','$desc',now())") or die(mysql_error())
<?php
//blocks gravs
?>