Change the addition handling part of your code, following in the same structure you are currently using it should change to this:
Code:
if(isset($_POST['save']))
{
$product = $_POST['product'];
$description = $_POST['discription'];
$price = $_POST['price'];
$techsheet = $_POST['techsheet'];
$catId = $_POST['category'];
if(!get_magic_quotes_gpc())
{
$product = addslashes($product);
$description = addslashes($description);
$price = addslashes($price);
$techsheet = addslashes($techsheet);
$catId = addslashes($catId);
}
include 'library/config.php';
include 'library/opendb.php';
$query = "INSERT INTO product_details (product, description, price, techsheet, cat_id) VALUES ('$product', '$description', '$price', '$techsheet','$catId')";
mysql_query($query) or die('Error ,query failed');
include 'library/closedb.php';
echo "Product '$product' added";
}
PEAR is a collection of php classes that simplify common tasks, it's really heavily used and well worth looking into. Personally I don't use it but thats cos i like reinventing the wheel and am a stick-in-the-mud :D