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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T20:25:11+00:00 2026-05-13T20:25:11+00:00

How would I limit this query so it only gives me one result? Code:

  • 0

How would I limit this query so it only gives me one result?

Code:

function next_prodn_header() {

    $StartDate = get('start_date');
    $timestamp = strtotime($StartDate);

    $EndDate = get('end_date');
    $Now = strtotime(date('d-m-Y'));
    $Start = strtotime($EndDate); 
    $newStart = date_i18n('d-m-Y', $Start);

    if ($Now <= $Start) {

 for ($i = 1; $i < 1; $i++) {
     echo "<h2>Next Event</h2>";
     echo "<span class=\"month\">";
     echo date_i18n('M', $timestamp);
     echo "</span>\n";
     echo "<span class=\"year\">";
     echo date_i18n('Y', $timestamp);
     echo "</span>\n\t\t";
     echo "<p><a href='";
     echo the_permalink();
     echo "' title='";
     echo the_title();
     echo "'>";
     echo the_title();
     echo "</a></p>\n\t\t";
     }
    } else {
  echo "";
    }
}
  • 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-13T20:25:11+00:00Added an answer on May 13, 2026 at 8:25 pm

    If by query you meant your for loop, start the loop at $i = 0. As of right now, your for-loop structure checks if 1 < 1 which evaluates to false, so it doesn’t run the code inside of the loop.

    Otherwise, I am not exactly sure what your question is regarding.

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

Sidebar

Related Questions

I would like to limit an application to having only one instance running on
I'm using the TServerSocket component in my Delphi application. I would like to limit
Would having a nice little feature that makes it quicker to write code like
I am trying to wrap my head around this one this morning. I am
I would like to get a sum from a column, with and without a
(please excuse that I didn't use aliases). I would like my query output to
I have to query a database of thousands of entries and order this by
The query below works well. However, I would like to modify it. I would
I'm stumped on a sql query. In a query, I have a result set
Would it not make sense to support a set of languages (Java, Python, Ruby,

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.