Welcome Guest, Not a member yet? Register   Sign In
Using where()->find() doesn't work as per my request!
#3

(02-08-2022, 10:06 AM)iRedds Wrote: 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();

if (
count($CheckService) === 1) {
    dd($CheckService[0]);

// or, if the type of the result is not important (object by default)
$CheckService $this->ServicesModel->where('id'$GetId)->get();

if (
$CheckService->getNumRows() === 1) {
    dd($CheckService->getFirstRow()); 


thanks for answering my question, Is there a way to not reset every condition?
Reply


Messages In This Thread
RE: Using where()->find() doesn't work as per my request! - by sialexsofficial - 02-09-2022, 07:35 AM



Theme © iAndrew 2016 - Forum software by © MyBB