hi i am having a problem about catching the specific error when saving a record on my database
$newproduct = new Tblproducts();
$newproduct->prod_id = $prodid;
$newproduct->prod_itemcode = $prodcode;
$newproduct->prod_brand = $prodbrand ;
$newproduct->prod_definition = $proddifinition;
$newproduct->prod_category = $prodcat;
$newproduct->prod_subcat = $prodsubcat;
$newproduct->prod_supplier = $prodsupp;
$newproduct->prod_manufacturer = $prodmanu;
$newproduct->prod_unit = $produnit;
$newproduct->prod_bigunit = $prodbigunit;
$newproduct->prod_smallunit = $prodsmallunit;
$newproduct->prod_physicalcount = $prodphysicalcount;
$newproduct->prod_batchnumber = $prodbatchnum;
$newproduct->prod_discount = $proddisc;
$newproduct->prod_istaxable = $prodvat;
$newproduct->prod_sellprice = $prodcost;
$newproduct->prod_purchaseprice = $prodpurchasecost;
$newproduct->prod_profit = $prodprofitvalue;
$newproduct->prod_purchasedate = $prodpurchasedate;
$newproduct->prod_expiredate = $prodexpiredate;
$newproduct->prod_status = $prodstatus;
$newproduct->prod_remarks = $prodremarks;
$newproduct->prod_addedby = $addedby;
$newproduct->prod_lastupdate = $dateadded;
if(!$newproduct->save()){
echo"error";
}
else{
echo"record saved";
}
what i want to do is get the specific error on why does the error occurs any help will do