How to check insert success or not When i using this code ?
i want to check insert success or not
if success echo "success";
else echo "error";
$link = mysql_connect($host, $user, $pass);
$sql = mysql_query("INSERT INTO `transaction` (txnid, pro_name, price, status)
VALUES (
'".$data['txn_id']."' ,
'".$data['pro_name']."' ,
'".$data['price']."' ,
'$status'
)", $link);
return mysql_insert_id($link);