我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

计算mysql中的数字 - codeigniter

enter image description here

How to find the number of occurances of open_id_fk in this table. I am using the below code in my model.

 $this->db->select('open_id_fk, COUNT(open_id_fk) as total');
 $this->db->group_by('open_id_fk'); 
 $this->db->order_by('total', 'desc'); 
 $query = $this->db->get('voting_ip', 10);
 return $query;

I am not getting proper output. the output is:

116 6
118 3
119 2 

HTML

 <div id="openletter" style="color:black;font-family:'Lato',sans-serif;"> <br>
 <?php echo "<br><br>".$row->open_id_fk;?><?php echo $row->total; ?>

近期文章

  • 铬网络面板响应选项卡中的未识别红点(json)
  • AJAX实时搜索JSON数组为空
  • PHP - 根据从选项中选择的内容获取值
  • 获取所有帖子,一个帖子,我的帖子等的URL设计
  • 使用逗号分隔值并一次性将其插入数据库
  • 使用PHP preg_replace将标识符转换为吸引人的标题
  • 使用脚本动态创建droppable div也是动态创建的
  • 如何使用php从您的网站上显示的mysql数据库中获取BLOB图像
  • 将页面设置为分类术语索引
  • android中的php响应字符串
  • Xml shoutcast到一个mysql数据库
  • Symfony2资产包问题
  • 将haystack数组重写为新数组
  • Ajax没有将数据传输到php文件
  • 如何使用key从数组中提取值
  • 无法在phpinfo中看到imagemagick
  • Magento - 隐藏残疾人类别
  • 以下是否有设计模式?
  • 如何在Object Array中将一个键映射到另一个键?
  • 使用cakephp魔术函数获取字段值

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华