• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to use Controller and Model in Codeigniter 4

#4
(06-03-2019, 10:04 PM)ashok.desai64 Wrote: Thanks very much. So you mean in Builder, I have to write query? can you please give me sample for builder file with query if possible.
You can try this code.
$user = new UserModek();
$query = $user->where('email', $email)->find();
in class userModel you can add method for complex query
function queryJoin()
{
return $this->join('users_groups', 'user.id=users_groups.user_id', 'inner')
->where('users_groups.group_id', 1)
->findAll();
}
Reply


Messages In This Thread
RE: How to use Controller and Model in Codeigniter 4 - by titounnes - 06-04-2019, 04:28 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.