Hello Everyone,
I have a Controllers :
------------------
<?php
namespace App\Controllers;
use App\Models\TPS_DetailModel;
use App\Models\TPSModel;
class TpsPar extends BaseController {
-------------------------------------------------
Two Models: TPSModel and TPS_DetailModel. (Like tables Order and Order Details).
Structure of the TPS table : {id_tps , name, status } . TPS_Detail: { id_tps_det , id_par, qty }.
Insert data to TPS Details successfully.
I want to update on table TPS field '
status' with
value 1 , when insert data to TPS Details successfully.
Data type of the '
status' field is integer.
Below my code in controller:
$varTPSModel = new TPSModel();
$builder = $varTPSModel->where('id_tps', $id_tps)->first();
// print_r($builder); This is Ok. return 1 row data
// exit;
$data = [
'status' => '1',
];
// Update the row in the table TPS
$builder->update($data);
I get error message, "Error Call to a member function update() on array".
How to fix issue ?
Thank you