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

The Archive Base Latest Questions

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

I have several activities in my database, but I would like to hide the

  • 0

I have several activities in my database, but I would like to hide the ones from the past, so I modified my MySQL request:

$sql = "SELECT * FROM tblAgenda WHERE date <= CURDATE() order by date ASC";

But it doesn’t do a thing except giving errors. What’s wrong?

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

    It seems like you’re not getting any results, so that is throwing errors. You always need to check for results before looping, you cannot just assume that every query will return something.

    Also, if you want things from the present/future, your comparison operand is backward:

    $sql = "SELECT * FROM tblAgenda WHERE date >= CURDATE() order by date ASC";
    

    Putting it together:

    $sql = "SELECT * FROM tblAgenda WHERE date >= CURDATE() order by date ASC";
    $result = mysql_query($sql);
    if (!$result) {
        // do something to handle zero results here
    } else {
        // do your usual while... loop
        while ($row = mysql_fetch_assoc($result)) {
            // code for each result row
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my application I have an Application and several Activities. I would like to
I have a program with several activities. One can start activity B from clicking
in my project i have a several activities.. but i have a one (parent)
I have an app consisting of several activities. I'd like a background music to
I have read posts on passing arrays from and to activities, but I am
In my application I have several activities, the main screen has 4 buttons that
I have an application with several activities and a lot of image resources. I
I have a one main Workflow which calls several activities asynchronously. Some of the
I have several cron jobs and I'd like to perform some calculations on them,
I have several models grouped in a module like this: #/app/models/blobs/small_text.rb class Blobs::SmallText <

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.