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

如何选择等于值的名称数量并保存找到的变量中的搜索次数[关闭]

I'm trying to select the number of names in the database equal to "dog", and save the number of searches found into a variable php? e.g number of dogs found = 4;. Where I can store this as a variable.

So far I got this:

SELECT id, COUNT(id) FROM `profiledb` GROUP BY id

Use it like this, assuming your name field

SELECT name, COUNT(id) as number_of_searches FROM profiledb WHERE name = 'dog'

近期文章

  • 使用php将html数据发送到打印机
  • 无法理解preg_match模式
  • 将foreach循环包装到div中不起作用[重复]
  • 发送联系表单时出现Mysql错误[关闭]
  • 坚持PHP程序。 需要一些想法
  • 如何使用php读取变量地址的整个页面
  • 如何检查网址页面中是否存在参数?
  • 我怎样才能在php中回应这个系列0110011001100110
  • js提交不起作用不发送表格数据到PHP
  • 这个正则表达式在PHP中工作,但不适用于JavaScript
  • 如何从mysql数据库中获取“下一个星期一”记录?
  • 当用C语言编写时,PHP如何成为脚本语言?
  • 如何使用php在字符串数组中找到重复字符串?
  • 如果用户使用网络,则显示警报
  • PHP - 比较两个日期[重复]
  • 将$ _GET值传递给$ _POST
  • Save.php“没有收到数据”
  • 未定义用户标识
  • 如何使用div作为输入? [关闭]
  • 鼠标悬停在文本上时显示链接[关闭]

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

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

友情链接:代码精华