Welcome Guest, Not a member yet? Register   Sign In
Count All
#1

[eluser]rochellecanale[/eluser]
hello guys how can i convert this code in active record:

Code:
$last_points = mysql_insert_id();
$sql = "SELECT COUNT(fkmember) FROM downline WHERE fkmember = {$last_points}";

any idea?
#2

[eluser]Beginers[/eluser]
http://ellislab.com/codeigniter/user-gui...ecord.html


Code:
$this->db->where('fkmember', $last_points);
$this->db->from('downline');
echo $this->db->count_all_results();
#3

[eluser]rochellecanale[/eluser]
i got 0 when i run it. what's wrong?
#4

[eluser]Beginers[/eluser]
I think the variable you supplied does not match in the db you. Try to use like function.

Code:
$this->db->like('fkmember', $last_points);
$this->db->from('downline');
echo $this->db->count_all_results();




Theme © iAndrew 2016 - Forum software by © MyBB