Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8937155
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:21:31+00:00 2026-06-15T10:21:31+00:00

This should address all other data with PHP/MySQL timestamp I have. Basically I use

  • 0

This should address all other data with PHP/MySQL timestamp I have. Basically I use the timestamp feature in MySQL and PHP

I insert using now for MySQL:

now()

or something like this in PHP:

$date=date("Y-m-d H:i:s");

This is some of my data:

Id          AdId    Unique Md5                                              Date                Stamp                                   IP

    61860       207     92cea3a296fdc76bac6fda219xxxxxx     2012-12-01  2012-12-01 17:48:31     74.125.181.xx
    61859       208     abe3aec5c24301db2d5803a310xxxxxx  2012-12-01    2012-12-01 17:48:31     74.125.181.xx
    61858       207     c93c67a013c64df53cbeec9346xxxxxx  2012-12-01    2012-12-01 17:48:11     95.21.xxx.138
    61857       207     596cf87f2405874c7172f6d0dcxxxxxx    2012-12-01  2012-12-01 17:47:54     188.xxx.98.242
    61856       212     bbba41c211e2829d622c55d00dxxxxxx  2012-12-01    2012-12-01 17:47:17     141.xxx.9.40

This is one of my queries. Basically I am trying to get row total for all the AdId with 207 and the timestamp of this month (2012-12)

SELECT COUNT(adid) AS hits FROM `ha1`.`adviews` WHERE `adid`='212' AND `stamp`='2012-12'

It returns 0 results. I was going to do:

<?php
$currentDate=date("Y-m-d H:i:s");
$currentMonth=date("Y-m");

$trafficsql=mysql_query("SELECT COUNT(adid) AS hits FROM `".$dn."`.`adviews` WHERE `adid`='".$rz["id"]."' AND `stamp`='".$currentMonth"'");
while($vss=mysql_fetch_array($trafficsql)){
    echo $vss["hits"];
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T10:21:31+00:00Added an answer on June 15, 2026 at 10:21 am

    Try

    $trafficsql=mysql_query("SELECT COUNT(adid) AS hits FROM `".$dn."`.`adviews` WHERE `adid`='".$rz["id"]."' AND DATE_FORMAT(`stamp`, '%Y-%m')='".$currentMonth"'");
    

    Use: DATE_FORMAT()

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This should be a simple one: I have an observableArray object called To in
This should be a no brainer but I have a small mystery with the
This should be simple, but I'm getting confused. I have a parent/child tables -
This should be a pretty straightforward question. I have the following code, which forms
This should be quite simple, but I can't work out the syntax. I have
This should be a simple issue but I can't figure this out. I have
I'm experiencing my first mysql INSERT tests and I'm using these tables: table employees
I have some trouble trying to setup a template to solve address this situation:
I need to get some data from a mysql database.I'm running a php script
MYSQL Database: I have a table of data that I need to put into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.