Welcome Guest, Not a member yet? Register   Sign In
Join in controller method
#7

All queries to retrieve data from database should be in models, controllers just call suitable model's methods and that's it.
If your model extends codeigniter's Model than there always available automated database connection which you can use ($this-db is a reference to default database connection).
select() is a Query Builder method. So use it with query builder, like:
$builder = $this-db->table('my_table_name');
$builder->select('my_variable1, my_variable2');
$query = $builder->get();
Reply


Messages In This Thread
Join in controller method - by pippuccio76 - 07-05-2021, 04:16 AM
RE: Join in controller method - by craig - 07-05-2021, 06:44 AM
RE: Join in controller method - by paliz - 07-05-2021, 12:13 PM
RE: Join in controller method - by ikesela - 07-05-2021, 12:22 PM
RE: Join in controller method - by pippuccio76 - 07-05-2021, 12:50 PM
RE: Join in controller method - by ikesela - 07-05-2021, 10:02 PM
RE: Join in controller method - by pippuccio76 - 07-06-2021, 03:54 AM
RE: Join in controller method - by manager - 07-05-2021, 10:23 PM



Theme © iAndrew 2016 - Forum software by © MyBB