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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T19:17:33+00:00 2026-05-24T19:17:33+00:00

I have the trouble to find is any new record is inserted in table.

  • 0

I have the trouble to find is any new record is inserted in table.

My problem

I am developing Penny auction site. In my site, I’m updating client side view every second using JQuery ajax.last bidder username, avater, price and many things were update.But when the bid is placed I want to apply flash effect for particular product live here. I tried the following Mysql query to find if any last bid is placed.

  SELECT   CASE  WHEN  COUNT(*)=0 THEN 'N' WHEN  COUNT(*) > '0' THEN 'Y'
   END AS is_bid  FROM table_bid_history WHERE product_id = '$value' AND 
   ( date_time BETWEEN DATE_SUB(NOW(), INTERVAL 1 SECOND) AND  NOW()  )

Basically, I’m storing last bidder details in table_bid_history table with time stamp column date_time. I’m sending ajax request every second to server side to get last update using recursive function. So my idea was minus 1 second checks correct time so I used ( date_time BETWEEN DATE_SUB(NOW(), INTERVAL 1 SECOND) AND NOW() ) and it Works. But in some case, delayed ajax polling makes this idea false, which means some time ajax request takes more than 1 second so I’m unable to get correct result from server. If I make INTERVAL 2 SECOND, then it gives Y for two times. So I’m confused what to do in this situation.

Please help me to get last activity in table. How they doing it. Any idea would be appreciated !

Thanks in advance

  • 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-24T19:17:33+00:00Added an answer on May 24, 2026 at 7:17 pm

    Instead of querying whether there was a bid in the last second, query if there was any new bid since the last known bid. So, in your jQuery code, store the date_time of the last bid that you know of. Then, though AJAX, see if there are any bids in your table_bid_history that have a date_time newer than the date_time stored in your jQuery script. If there are, flash for effect (and of course, store the newer date_time for more querying later on).

    PS: You may want to look into long polling. That may be better on resources than frantically re-checking every second.

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

Sidebar

Related Questions

I'm having trouble with a well-known problem but I can't find any solutions. I
I'm having some trouble with an SQL statement that have to find the number
Having a bit of trouble using the List.Find with a custom predicate i have
I have trouble shooting at file download problem. In Chrome, the download works fine.
I'm having trouble trying to find any tutorials on how to make a paging
I'm new to CMake and have trouble understanding some usage concepts. I'm calling a
I've searched on SO and didn't find any answer to the problem I'm having.
I have been developing our php based site on a development box that was
Pretty new to Mono for Android (C#), and I'm seeming to have trouble during
I have trouble figuring out why a simple division like this one always returns

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.