Hi, sir Update query is not working |
if ($invoice_no != null) {
// echo "This is last invoice number" . $invoice_no; for ($i = 0; $i < count($ar_price); $i++) { $rem_qty = $ar_tqty[$i] - $ar_qty[$i]; if ($rem_qty < 0) { echo "Product Out Of Stock!"; } else { $modelpro = new productModel(); $db = \Config\Database::connect(); $builder = $db->table('product'); //Update Product stock $updateQuantity = [ 'Quantity' => $rem_qty, ]; // if ($modelpro->update($updateQuantity)->where('productName', $ar_pro_name[$i])) { // echo "updated"; // } else { // echo "update query error"; // } $builder->where('productName', $ar_pro_name[$i]); $builder->update($updateQuantity); } } } |
Messages In This Thread |
Hi, sir Update query is not working - by sandeep1992 - 04-15-2021, 10:23 PM
RE: Hi, sir Update query is not working - by php_rocs - 04-16-2021, 07:18 AM
RE: Hi, sir Update query is working after two days searching And I am using CI 4 - by sandeep1992 - 04-16-2021, 11:16 AM
RE: Hi, sir Update query is not working - by davis.lasis - 04-16-2021, 12:21 PM
|