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

  • SEARCH
  • Home
  • 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 6776997
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:05:44+00:00 2026-05-26T16:05:44+00:00

I have a this weeks current totals, from monday to monday and Last weeks

  • 0

I have a this weeks current totals, from monday to monday and Last weeks totals. I have been manually updating the timestamps to reflect the current and last week. I would like have it just pull the data from the current week from monday to monday and last weeks from monday to monday

This weeks code.

echo "This Week&nbsp;<br />";
$result = mysql_query("SELECT * FROM form_2 WHERE timestamp BETWEEN '2011-11-7' AND '2011-11-14' AND checkcollec = 'yes'");
$num_rows = mysql_num_rows($result);

echo "<b>Checks Collected:</b> $num_rows &nbsp;";

Last weeks Code.

echo "<hr />Last Week&nbsp;<br />";
$result = mysql_query("SELECT * FROM form_2 WHERE timestamp BETWEEN '2011-10-31' AND '2011-11-07' AND checkcollec = 'yes'");
$num_rows = mysql_num_rows($result);

echo "<b>Checks Collected:</b> $num_rows &nbsp;";

How can I do this so I do not have to keep changing it manually each week.

  • 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-05-26T16:05:45+00:00Added an answer on May 26, 2026 at 4:05 pm
    $today = date("Y-m-d");
    $todayMinusSeven = date("Y-m-d",strtotime("-7 days"));
    
    $query = "SELECT * FROM form2 WHERE timestamp BETWEEN '$todayMinusSeven' AND 
        '$today' AND checkcollec = 'yes'";
    
    echo $query;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been stuck with this for weeks now and have no idea where I'm
so i have been stuck with this issue for 3 weeks now and i
We have been having some debate this week at my company as to how
So I have been dabbling around in jQuery a bit this week. Trying to
If I have this select: <select id=days> <option value=0>Today</option> <option value=1>Yesterday</option> <option value=7>Last week</option>
I've been working on this for the past 2 weeks - i have an
I have literally been searching for this for weeks. I am a novice java
I have been slowly learning SQL the last few weeks. I've picked up all
I want to learn .NET and I have 2 weeks time of this. I
I am trying to list the people who have birthday this week with this

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.