Welcome Guest, Not a member yet? Register   Sign In
Display single record in view
#2

[eluser]Andy UK[/eluser]
You'll need to pass the id of the record you want to retrieve to the model. You can do this my constructing a link that includes the id

http://yoursite.com/controller/function/id

and then grabbing that id in the controller function using

$id = $this->uri->segment(3);

You can then retrieve the necessary data for that record by calling the model function and passing it the id

$result = $this->your_model->your_function($id);

Now you have the fields for the record you queried in the $result variable which can be passed to the view to do your foreach loop.

I recommend your work through the video tutorials on the nettuts website, especially the CRUD one which will walk you through this whole process..
http://net.tutsplus.com/category/tutorials/php/


Messages In This Thread
Display single record in view - by El Forum - 12-04-2010, 12:21 PM
Display single record in view - by El Forum - 12-04-2010, 09:28 PM
Display single record in view - by El Forum - 12-05-2010, 06:04 AM
Display single record in view - by El Forum - 12-05-2010, 07:15 AM
Display single record in view - by El Forum - 12-05-2010, 08:23 PM
Display single record in view - by El Forum - 12-05-2010, 09:57 PM
Display single record in view - by El Forum - 12-05-2010, 10:10 PM
Display single record in view - by El Forum - 12-05-2010, 11:43 PM
Display single record in view - by El Forum - 12-06-2010, 12:25 AM
Display single record in view - by El Forum - 12-06-2010, 12:32 AM
Display single record in view - by El Forum - 12-06-2010, 12:41 AM
Display single record in view - by El Forum - 12-06-2010, 12:44 AM
Display single record in view - by El Forum - 12-06-2010, 12:46 AM
Display single record in view - by El Forum - 12-07-2010, 06:00 AM



Theme © iAndrew 2016 - Forum software by © MyBB