Welcome Guest, Not a member yet? Register   Sign In
handling query results with codeigniter
#3

[eluser]joeizang[/eluser]
Thanx BrainDHall,

Your explanation was spot-on. But rather than echo, I did the following to the foreach and it worked beautifully:

<?php

function gettitle3()
{
$this->db->select('articletitle');
$this->db->from('articles');
$this->db->where('articlecategory',2);
$query = $this->db->get();
if($query->num_rows() > 0)
{
$Q = $query->result_array();
foreach($Q as $value){
$data[] = $value;
}
return $data;
}
}
?>
Thanx again,


Messages In This Thread
handling query results with codeigniter - by El Forum - 10-07-2009, 08:31 AM
handling query results with codeigniter - by El Forum - 10-07-2009, 08:36 AM
handling query results with codeigniter - by El Forum - 10-07-2009, 08:53 AM



Theme © iAndrew 2016 - Forum software by © MyBB