How to Automatically Update MySQL Data?

lostcommander

Member
Messages
52
Reaction score
0
Points
6
One of the things my site allows users to do is bid in an auction using points. The system works fine, but I have to manually "finish" each auction. After the close time of an auction, I go to an administration page and press a button to generate a transaction (including the final subtraction of points from accounts and relief/return of points held in reserve to cover bids) for the auction. There MUST be a way to do this automatically (triggered by the timestamp noting the end of the auction). If this was running on a personal server instead of x10, I could try writing a C program or something that just ran constantly and repeatedly checked the database for closed and unfinished auctions?

Does anyone know how (or if) this can be done for x10 websites, or more generally how to do this on any webserver (or a better way to perform the whole auction process)? Thanks!
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
Run a cron job every 10 minutes or so (depending on how your auctions are set up...if they all end on the hour, just run the job at 2 minutes past the hour etc).
 

lostcommander

Member
Messages
52
Reaction score
0
Points
6
Okay. The cron jobs seem 'nix based, which is something I have very little experience with. In the "command to run", can I simply put a PHP file outside of my www area and target that? e.g. /home/user/folder/file.php
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
Code:
/usr/local/bin/php -q  /home/USERNAME/etc/cronjobtorun.php

Works for me.
 
Top