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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T13:34:53+00:00 2026-06-02T13:34:53+00:00

I am designing an event feed from a calender I made. I’m using the

  • 0

I am designing an event feed from a calender I made. I’m using the same data from the database but to match specific dates and times.

  1. I only want 4 events to show at once (why I specified length < 4)
  2. Where the database value 'showFeed' is true, it only displays those rows.
  3. and I want it to show by date time, I have odd id’s for each value in the database, which might make them out of order.

My current code:

$sql = "SELECT `title`, `time`, `start`, `showFeed` FROM calender WHERE length('column') > '0'";

$result = $dbh->query($sql)->fetchAll(PDO::FETCH_ASSOC);

echo "<div class=\"eventfeed\">";
echo "<ul>";

foreach ($result as $row){

$show = $row['showFeed'];

if ($show == 1 && length.$result < 4){
    echo "<li>";
    echo $row['title']. "<br />";
    echo $row['start'].' '.$row['time'];
    echo "</li>";
} 
else {

    return false;
}
}

echo "</ul>";
echo "</div>";

$dbh = null;

echo json_encode($return);

?>

I’m getting results and no errors from the database, but I’m only seeing one return on $results.

I honestly, do not have a clue where else to go from here. I’m lost.

  • 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-06-02T13:34:53+00:00Added an answer on June 2, 2026 at 1:34 pm

    For 1+.2.+3. modify your query to SELECT title, time, start, showFeed FROM calender WHERE length('column') > '0' and showFeed=1 and time<current_timestamp ORDER BY time DESC LIMIT 0,3 and remove your if (...) statement.

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

Sidebar

Related Questions

When designing an XML feed for structured data, what is good practice, and what
I'm designing a schema for an event registration system which will involve students from
I'm designing a staff rota planner....have three tables Staff (Staff details), Event (Event details),
Designing forms has always been fun, but getting them to send email on the
When designing a stock management database system for sales and purchases what would be
While designing a new WPF application I noticed exceptions not being thrown during data
I am currently designing a dashboard feed that functions similar to the facebook feed.
I have a database of events which gets updated every night. A single event
I'm designing an application that processes RSS feeds using MongoDB. Currently my collections are
I'm designing a daemon that will continuously read lines from a single text file

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.