Welcome Guest, Not a member yet? Register   Sign In
Where Query
#1

[eluser]Yash[/eluser]
function ReadComments($UrlTitle)
{



$this->db->where(array('UrlTitle'=>$UrlTitle));
$query = $this->db->get('comments');
$posts = $query->row_array();
return $posts;

}

It return only one row.

I want all of the rows for where query.
#2

[eluser]daulex[/eluser]
Put the readcomments($urltitle) in a foreach loop in the template?
There is an example of a froeach loop in a video tutorial made by Derek Jones.
#3

[eluser]Yash[/eluser]
I'm putting everything in a array. I know foreach.

Is my code is right? if yes why only one row [in array]
#4

[eluser]Derek Allard[/eluser]
result_array() vs row_array()?
#5

[eluser]Yash[/eluser]
ohhh my bad

thank so much it works.
#6

[eluser]Derek Allard[/eluser]
My pleasure Yash.




Theme © iAndrew 2016 - Forum software by © MyBB