![]() |
Using where()->find() doesn't work as per my request! - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=31) +--- Thread: Using where()->find() doesn't work as per my request! (/showthread.php?tid=81234) |
Using where()->find() doesn't work as per my request! - sialexsofficial - 02-08-2022 Code: public function __construct() above is the code snippet in my controller..I expect that generated from dd($CheckService->find()); only one, because I use the function where(),,,I want to get certain data using where,,But why does everything in the database come out? RE: Using where()->find() doesn't work as per my request! - iRedds - 02-08-2022 The find() method without passing in an ID behaves just like the findAll() method; Also after each query, all conditions are reset. You can use a solution like this. PHP Code: $CheckService = $this->ServicesModel->where('id', $GetId)->findAll(); RE: Using where()->find() doesn't work as per my request! - sialexsofficial - 02-09-2022 (02-08-2022, 10:06 AM)iRedds Wrote: The find() method without passing in an ID behaves just like the findAll() method; thanks for answering my question, Is there a way to not reset every condition? |