Skip to content

Instantly share code, notes, and snippets.

@n5i
Created October 31, 2012 18:28
Show Gist options
  • Save n5i/3988905 to your computer and use it in GitHub Desktop.
Save n5i/3988905 to your computer and use it in GitHub Desktop.
yii get records count
$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