Welcome Guest, Not a member yet? Register   Sign In
passing query results from model to view
#2

[eluser]ns8814[/eluser]
ok so I put the model in the typical fashion. as follows.To explain my question better. I don't want to have to write a foreach in the view inorder to get some data from the array.

MODEL VIEW
Code:
function get_project_details($projectID)
{
  $this->db->where('projectID',$projectID);
  $query=$this->db->get('deck_'."projects");

  return $query->result();
  
}

CONTROLLER VIEW
Code:
$data['pdetails']=$this->estimates_model->get_project_details($projectID);
$this->load->view("templates/Default/"."admin_view2",$data);

So lets say a table column is 'projectname'
How can get that data out in the view without having to use a foreach statement. This way I can use the isset() function to populate the form.


Messages In This Thread
passing query results from model to view - by El Forum - 10-10-2012, 06:49 AM
passing query results from model to view - by El Forum - 10-10-2012, 08:10 AM
passing query results from model to view - by El Forum - 10-10-2012, 09:08 AM
passing query results from model to view - by El Forum - 10-10-2012, 10:47 AM
passing query results from model to view - by El Forum - 10-10-2012, 02:43 PM
passing query results from model to view - by El Forum - 10-11-2012, 06:54 AM
passing query results from model to view - by El Forum - 10-11-2012, 07:14 AM
passing query results from model to view - by El Forum - 10-11-2012, 11:01 AM
passing query results from model to view - by El Forum - 10-12-2012, 08:34 PM



Theme © iAndrew 2016 - Forum software by © MyBB