#51 CRUD Operation part 1 | Automatic Models | CodeIgniter 4 Tutorials

preview_player
Показать описание
In this session we discussed about CRUD operation by using automatic models
Models provide a way to interact with a specific table in your database.
We can interact with a database tables, including finding records, updating
records, deleting records, and more.
To do these operations, we used the traditional approach.
But Here, CI4, is providing helper methods to do these operations.
Рекомендации по теме
Комментарии
Автор

awsome tutorial sir. How do I get the last inserted ID with the save method?

dagmartin
Автор

Problem and Solution
It working. I have soved it after trying 5/6 hours.
Problem: ErrorException Trying to get property of non-object.

Solution: Here is total addemp function.
public function addemp()
{
=='post') {

$data =[
'name' => $this->request->getVar('name', FILTER_SANITIZE_STRING),
'email' => $this->request->getVar('email', FILTER_SANITIZE_EMAIL),
'mobile' => $this->request->getVar('mobile'),
'salary' => $this->request->getVar('salary', FILTER_SANITIZE_STRING),
];

if ($this->EmModel->save($data) === true){
$session ->setTempdata('success', 'Successfuly Saved', 2);
}elseif ($this->EmModel->save($data) === false) {
return view('employee', ['errors' => $this->EmModel->errors()]);
}


}
return view('employee');
}

auser
Автор

Sir when i add second argument of error
return view('empadd_view', ['errors' => $this->empModel->errors()]);

i get an error Attempt to read property "errno" on bool

Please it's Humble request what can i do please sir
My FYP depend on it

hassanfarooq
Автор

great sir, but please if I want to select it in descending, how will I do it ?

neajinnovations
Автор

can you add the code to set the value remains display in the field even some error comes

codetheworld
Автор

Sir make a video on payment gateway using codeigniter4....plz

manideep_talampally
Автор

Every available library file is in codeigniter 3 and not able to run using different syntex style in Codeigniter 4.

jayantsingh
Автор

return view('empadd_view', ['errors'=>$this->empModel->errors()]); in this line I got error like this
Call to a member function errors() on null
Please solve this ..

azimunnisashaikh
Автор

Create multi vender e-commerce complete project with different payment method video create karan

nasirjaveed