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

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();


                        $modelpro
                            ->where('productName'$ar_pro_name[$i])
                            ->set(['Quantity' => $rem_qty])
                            ->update();
                    }

                    $modelInvo = new invoiceDetailModel();
                    $saveInvoiceDetail = [
                        'invoice_no'   => $invoice_no,
                        'product_name' => $ar_pro_name[$i],
                        'price'        => $ar_price[$i],
                        'qty'          => $ar_qty[$i],
                    ];

                    $modelInvo->save($saveInvoiceDetail);
                }
            }
Reply


Messages In This Thread
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



Theme © iAndrew 2016 - Forum software by © MyBB