문제

i'm working on something like the auction, and when the user creates the lot, he need to set the time of it duration. When this time ends i need to close the auction for this lot, and choose the last bid for the deal. What is the best practice for monitoring the auctions state? I was looking at the mysql events or gearman, maybe someone can describe another suggestion for such things?

도움이 되었습니까?

해결책

The question is why do you need a MySQL Event? You can make two fields in your database with starttime and endtime you can choose datetime for this fields. All actions you need you can indicate in your application.

Something like:

if actual_time => starttime and actual_time <= endtime

For all bids you save the bid in the database. If the the time is empty don't insert new bids.

This is only visible if you reload the page. Otherwise you have to implement some ajax solutions which ask the server for the last state and replace it on your website.

If you only want a MySQL Event you can look for Triggers which are called on a defined state like an Update or an Insert.

http://dev.mysql.com/doc/refman/5.1/de/create-trigger.html

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top