Is there a way that I can count the total data that i have? example is that, I have a student table and in a student table there is a student_gender.
The thing is I want to count all the female gender that I have, and if possible i want to post it in a page thanks
Page 1 of 1
Counting Total Data Counting total data
#2
Posted 06 December 2012 - 07:34 PM
You could use this - http://www.yiiframew...ributes-detail.
Example:
This code assumes that Student is an Active Record class for your student db table.
Example:
$countFemale = Student::model()->countByAttributes(array('student_gender' => 'female'));
echo $countFemale;
This code assumes that Student is an Active Record class for your student db table.
Share this topic:
Page 1 of 1

Help












