dongweizhen2009 2015-10-31 05:14
浏览 64
已采纳

如何在yii php标签的索引页面中计算数据库中的空字段

I want to count readdate which must be null in table,i want to fire code in html , there is one table wich contain field like id,storeid,message,readdate,entrydate , if readdate is null then i want to count is and display thos count

<html>
   <div class="orange-count">
      <?php
         echo $unread_recommendation = Storenotification::model()->count("id='" . Yii::app()->session['id'] . "' AND readdate='null' ");
       ?>
   </div>
</html>
  • 写回答

2条回答 默认 最新

  • drwurqczo39355510 2015-10-31 05:33
    关注

    Sql command for NULL count

    select count(*) from table where column IS NULL;
    

    Change it according to your framework.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥50 opencv4nodejs 如何安装
  • ¥15 adb push异常 adb: error: 1409-byte write failed: Invalid argument
  • ¥15 nginx反向代理获取ip,java获取真实ip
  • ¥15 eda:门禁系统设计
  • ¥50 如何使用js去调用vscode-js-debugger的方法去调试网页
  • ¥15 376.1电表主站通信协议下发指令全被否认问题
  • ¥15 物体双站RCS和其组成阵列后的双站RCS关系验证
  • ¥15 复杂网络,变滞后传递熵,FDA
  • ¥20 csv格式数据集预处理及模型选择
  • ¥15 部分网页页面无法显示!