Welcome Guest, Not a member yet? Register   Sign In
my database issues are like trying to learn klingon
#1

[eluser]pdxbenjamin[/eluser]
This is an example model i've been trying to get working...
Code:
$this->db->from('yourtable');
[... more active record code ...]
$query = $this->db->get();
$rowcount = $query->num_rows();

How do i get $rowcount back into the controller?
#2

[eluser]umefarooq[/eluser]
just return the $rowcount from your model function

Code:
function model_function(){

$this->db->from('yourtable');
[... more active record code ...]
$query = $this->db->get();
$rowcount = $query->num_rows();

return $rowcount
}
#3

[eluser]pdxbenjamin[/eluser]
ahh thanks, I was writing out a big reply, but answered my own question.... by just thinking it through and typing it out.




Theme © iAndrew 2016 - Forum software by © MyBB