I want to count readdate which must be null in table. I want to fire code in html, there is one table which contains fields like id, storeid, message, readdate, entrydate. If readdate is null then I want to count it and display those counts.
<html>
<div class="orange-count">
<?php
echo $unread_recommendation = Storenotification::model()->count("id='" . Yii::app()->session['id'] . "' AND readdate='null' ");
?>
</div>
</html>
Sql command for NULL count
select count(*) from table where column IS NULL;
Change it according to your framework.