where('id',5); 这可能吗? 如果有任何其他方法可以做到这一点,请告诉我。谢谢 我想像上面-6ren">
gpt4 book ai didi

php - 是否可以在 codeigniter 中用 where 条件计算所有?

转载 作者:行者123 更新时间:2023-11-30 23:55:32 26 4
gpt4 key购买 nike

我正在尝试做这样的事情

$this->db->count_all("grant_money")->where('id',5);

这可能吗?

如果有任何其他方法可以做到这一点,请告诉我。谢谢

我想像上面那样在单行代码中执行此查询

最佳答案

你可以像这样使用它。

$this->db->where('id',5);
$this->db->from("grant_money");
echo $this->db->count_all_results();

这将显示带有 where 条件的所有计数。

用单行试试这样

echo $this->db->where('id',5)->from("grant_money")->count_all_results();

关于php - 是否可以在 codeigniter 中用 where 条件计算所有?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32197612/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com