Welcome Guest, Not a member yet? Register   Sign In
Hi, sir Update query is not working
#1

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);
                    }
                }
            }
Reply


Messages In This Thread
Hi, sir Update query is not working - by sandeep1992 - 04-15-2021, 10:23 PM



Theme © iAndrew 2016 - Forum software by © MyBB