Created
October 31, 2012 18:28
-
-
Save n5i/3988905 to your computer and use it in GitHub Desktop.
yii get records count
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$sql = "SELECT COUNT(*) FROM table WHERE 1"; | |
$records_count = Yii::app()->db->createCommand( $sql )->queryScalar(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment