Welcome Guest, Not a member yet? Register   Sign In
me failing with $query->result()
#2

[eluser]n0xie[/eluser]
[quote author="devvee" date="1241723328"]Hi!
Code:
$this->load->model('Question_model', '', TRUE);
$data['query'] = $this->Question_model->get_open_questions();
[/quote]

Your resultset is stored in the $data array as 'query'. The load->view automatically serializes this for you so your resultset is available through $query inside your view.

Try this from your view:
Code:
var_dump($query);

It should return the full resultset. From there you can use any iteration you prefer to extract the data you want. The most used would be something like this (depending on what type of dataset you returned:

Code:
foreach ($query as $row)
{
  echo $row['somefield'];
  // or if you returned an object
  echo $row->somefield;
}


Messages In This Thread
me failing with $query->result() - by El Forum - 05-07-2009, 08:08 AM
me failing with $query->result() - by El Forum - 05-07-2009, 08:13 AM
me failing with $query->result() - by El Forum - 05-07-2009, 08:15 AM
me failing with $query->result() - by El Forum - 05-07-2009, 10:08 AM
me failing with $query->result() - by El Forum - 05-07-2009, 10:39 AM



Theme © iAndrew 2016 - Forum software by © MyBB