如何选择每个月的数据库内容?
我的数据库中有名为访问的表,如下所示:
id ip action_date|time_stamp
我使用此代码来存储网站访问,
/* Hits table has an auto-incrementing id and an ip field */
// Grab client IP
$ip = $this->input->ip_address();
// Check for previous visits
$query = $this->db->get_where('visits', array('ip' => $ip), 1, 0);
$query = $query->row_array();
if (count($query) < 1 )
{
// Never visited - add
$this->db->insert('visits', array('ip' => $ip) );
}
它工作得很好。但我的客户需要知道他们一个月内有多少次访问。我该怎么做?坦克。
i have table named visits in my database like this :
id
ip
action_date|time_stamp
i use this code to store site visits
/* Hits table has an auto-incrementing id and an ip field */
// Grab client IP
$ip = $this->input->ip_address();
// Check for previous visits
$query = $this->db->get_where('visits', array('ip' => $ip), 1, 0);
$query = $query->row_array();
if (count($query) < 1 )
{
// Never visited - add
$this->db->insert('visits', array('ip' => $ip) );
}
it's working nice . but my client need to know how many visits they have in month . how can i do that ? tanks .
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
怎么样:
应该给你这样的数据:
How about something like:
Should give you data like: