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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T05:55:38+00:00 2026-06-07T05:55:38+00:00

How would I display rows that have a timestamp value within the last hour?

  • 0

How would I display rows that have a timestamp value within the last hour?

Here is what I have right now, and it is showing the latest rows, and only 3 rows because of the LIMIT.

$query5= mysql_query("SELECT * FROM  `made_orders` ORDER by id DESC LIMIT 0,3");



    WHILE($datarows5 = mysql_fetch_array($query5)):

    $name4 = $datarows5['Name'];
    $phone4 = $datarows5['Phone'];
    $entree4 = $datarows5['Entree'];
    $side14 = $datarows5['Side 1'];
    $side24 = $datarows5['Side 2'];
    $drink4 = $datarows5['Drink'];
    $totalcost4 = $datarows5['Total Cost'];
    $ip4 = $datarows5['Ip'];
    $id4 = $datarows5['id'];
    $time4 = $datarows5['timestamp'];

    echo "<iframe src=\"creatmeal-data.php?id={$id4}\" width=\"430px\" style=\"border:0px\" height=\"350px\"/></iframe>";

endwhile; ?>

In my above code, each time a row is found, it echos an iframe. How would I edit the query to use my timestamp column to show only the latest within an hour.

Thanks in advance for your help!

EDIT: Here is what my timestamp column looks like: http://img856.imageshack.us/img856/4135/columnk.png

  • 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-07T05:55:39+00:00Added an answer on June 7, 2026 at 5:55 am

    Your current query gets the three most recent orders regardless of whether or not they were created in the last hour.

    Use this solution:

    SELECT *
    FROM made_orders
    WHERE timestamp >= NOW() - INTERVAL 1 HOUR
    ORDER BY timestamp DESC
    LIMIT 3
    

    This would get at most three orders within the last hour. If there was only one order within the last hour, it would only select one row.

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

Sidebar

Related Questions

I have a GridView control that I would like to display the rows of
So here's the scenario, I'm building a theme that would display sub category of
I have a ListView subclass that display rows that each contain an EditText and
I would like to create a table with django-tables2 such that different rows have
I have a table with various rows that display data, in each row I
I have the following code that I use to display detail rows in a
I would like to create an iphone application that displays three rows of infinite
I have a label which would display strings from 0 ft to say 999
I want to make an application that would display a message when a user
By that I mean... if I have a column named special and rows that

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.