Welcome Guest, Not a member yet? Register   Sign In
Passing $_GET[] data to the controller to display database information back to the view....
#1

[eluser]ninja.dude[/eluser]
for example if I have a URL like index.php?profile_id=1

and I want to get that ID=1 and send it to the controller to query the db for all records where id = 1



I am not using models doing query from controller.
#2

[eluser]toopay[/eluser]
Code:
$id = $this->input->get('profile_id', TRUE);
// Using CI ActiveRecord
$qry = $this->db->where('id', $id)->get('some_table');
// Or...using my dbhelper lib
$qry = $this->dbhelper->select_from_sometable_where_id($id)->execute();




Theme © iAndrew 2016 - Forum software by © MyBB