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 934463
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T21:00:19+00:00 2026-05-15T21:00:19+00:00

I am looking to produce a function where I check the date is in

  • 0

I am looking to produce a function where I check the date is in the last fortnight.
This is something I have never done before.

I have produced a mysql_query

$q = "SELECT date_subbmited FROM ".TBL_CONF_RESULTS." WHERE home_user = '$u' OR away_user = '$u'";

That would select the date and in PHP i could check whether it was in the last fornight?

Or I could check within the SQL if the date was within the last fornight?

Whats the best practice here?
And how would I go about doing this?

date_submitted is the date i want to check, and $u is just the username.

Thanks

  • 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-15T21:00:20+00:00Added an answer on May 15, 2026 at 9:00 pm

    Take a look at DATE_SUB().

    Example:

    $q = "SELECT date_subbmited FROM ".TBL_CONF_RESULTS." WHERE (home_user = '$u' OR away_user = '$u') AND date_subbmited >= DATE_SUB(CURDATE(),INTERVAL 14 DAY)";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am looking for a one-line function f = @(x) {something} that produces NaN
I have a template looking like this: struct add_node_value_visitor : boost::static_visitor<> { add_node_value_visitor(){} template
I've been looking for this information for my commercial desktop product, with no avail.
I am working on implementing a spell check function for a web-based WYSIWYG editor.
I have a thread that, when its function exits its loop (the exit is
PHP.net 's documentation on the range function is a little lacking. These functions produce
I have a producer/consumers design in my application which implement Produce/Consume functions on user
This question isn't really a problem looking for a solution, it's more just a
I have been searching for a an answer to this for a roughly 2
Hello I am looking for a way to produce the same result as with

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.