php - 重新创建/找到 Joomla/Community Builder 'Latest Users' 模块。 MySQL/Joomla 中的日期

标签 php mysql joomla joomla1.5

当 Joomla 第一次出现并且我从 Mambo 搬过来时,我记得找到了一个名为 Community Builder (CB) 的组件,它扩展了 Joomla 背后基于用户的界面。

我记得我在 CB 中发现的一个小模块显示了一些关于用户的有用详细信息,我希望能够从我当前的项目中提取这些信息。这些详细信息包括:

  • 注册用户总数
  • 每天注册的用户总数
  • 每周注册用户总数
  • 每月注册用户总数
  • 最新注册的用户
  • 网站的总访问者

我的问题是如何重新创建非常相似的东西。我一直在尝试构建一个 SQL 语句来操作用户表结果并将它们与一组标准进行比较,例如。查找上周内具有“registerDate”变量的所有用户。

让我迷失的问题是如何操作和比较类似于“2008-08-05 07:41:40”的日期字符串

最佳答案

The problem that has me lost is how to manipulate and compare a date string that resembles '2008-08-05 07:41:40'

您可以让 MySQL 将其转换为 UNIX 时间戳,或者您可以通过 strtotime 运行它。

MySQL:

SELECT UNIX_TIMESTAMP(datetime_field) FROM table

时间:

$timestamp = strtotime('2008-08-05 07:41:40');

关于php - 重新创建/找到 Joomla/Community Builder 'Latest Users' 模块。 MySQL/Joomla 中的日期,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/575218/

相关文章:

php - MYSQL Update 只返回 TRUE,不返回 FALSE?

mySql 触发器未按预期工作

php - 从 Controller 任务 joomla 调用 View 方法

jquery - 用jquery触发Joomla的rokbox

git - 开发工作流程,Joomla,GIT

php - { } codeigniter 模型/ View 中的大括号

php mySQL,按数字检索一行,将值存储为 assoc.array

php - PHP 扩展类是否也继承接口(interface)?

php - Mysql db 类 - 连接问题

php - bind_param() 中的第一个参数到底做了什么?