I'm trying to update a table using this query but does not seem to work.
$query="UPDATE product SET qty = (qty - '$qty') WHERE barcode = '$barcode'";
$result = $this->db->conn_id->prepare($query);
$result->execute();
I've tried placing the query inside a try catch block but it does not throw any error. The issue is with the implementation in CodeIgniter as this query is working when executed outside codeigniter.