/    Sign up×
Community /Pin to ProfileBookmark

Multiple if (conditions)’s ???

Alright so I have a list of upcoming events and I want it to ONLY show the upcoming events from the next 7 days. So I need 2 if (conditions):

[LIST]

  • [*]

    if (date is greater than or equal to today)


  • [*]

    if (date is less than or equal to today’s date plus 7)


  • [/LIST]

    How do I use 2 if conditions? How would I write “today’s date plus 7”?

    Here’s the original script which displays ALL future upcoming events.

    [CODE] if ($row[‘date’] >= date(‘Y-m-d’))
    {
    displayEvents($row);
    }[/CODE]

    to post a comment
    PHP

    2 Comments(s)

    Copy linkTweet thisAlerts:
    @MindzaiApr 22.2009 — [code=php]$date = strtotime($row['date']);
    if ($date >= time() && $date <= strtotime("+1 week")) {
    // some time in the next week
    }[/code]
    Copy linkTweet thisAlerts:
    @shizzzleeauthorApr 22.2009 — ty!!!!!!! ?
    ×

    Success!

    Help @shizzzlee spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 12.1,
    social: @webDeveloperHQ,
    });

    legal: ({
    terms: of use,
    privacy: policy
    analytics: Fullres
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: Anonymous,
    tipped: article
    amount: 1000 SATS,

    tipper: @aldoushuxley,
    tipped: article
    amount: 1000 SATS,

    tipper: Anonymous,
    tipped: article
    amount: 1000 SATS,
    )...