+ Reply to Thread
Results 1 to 4 of 4

Thread: How to Automatically Update MySQL Data?

  1. #1
    lostcommander's Avatar
    lostcommander is offline x10Hosting Member lostcommander is an unknown quantity at this point
    Join Date
    Apr 2009
    Location
    United States of America
    Posts
    52

    Question How to Automatically Update MySQL Data?

    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!

  2. #2
    descalzo's Avatar
    descalzo is offline Grim Squeaker descalzo has a brilliant futuredescalzo has a brilliant futuredescalzo has a brilliant future
    Join Date
    Jul 2009
    Location
    Ankh-Morpork
    Posts
    7,636

    Re: How to Automatically Update MySQL Data?

    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).

  3. #3
    lostcommander's Avatar
    lostcommander is offline x10Hosting Member lostcommander is an unknown quantity at this point
    Join Date
    Apr 2009
    Location
    United States of America
    Posts
    52

    Re: How to Automatically Update MySQL Data?

    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

  4. #4
    descalzo's Avatar
    descalzo is offline Grim Squeaker descalzo has a brilliant futuredescalzo has a brilliant futuredescalzo has a brilliant future
    Join Date
    Jul 2009
    Location
    Ankh-Morpork
    Posts
    7,636

    Re: How to Automatically Update MySQL Data?

    Code:
    /usr/local/bin/php -q  /home/USERNAME/etc/cronjobtorun.php
    Works for me.

+ Reply to Thread

Similar Threads

  1. Chopin showing old MySQL database data
    By albatross in forum Free Hosting
    Replies: 3
    Last Post: 11-09-2009, 09:15 PM
  2. MySQL Data Restore
    By risingdevil in forum Free Hosting
    Replies: 1
    Last Post: 11-03-2009, 05:04 AM
  3. Suggestions for best way to build a MySQL table from raw data?
    By ParallelLogic in forum Programming Help
    Replies: 5
    Last Post: 07-05-2009, 02:39 AM
  4. PHP MySQL update
    By espfutbol98 in forum Programming Help
    Replies: 9
    Last Post: 05-25-2009, 01:24 AM
  5. Update and MYSQL
    By Aravinthan in forum Programming Help
    Replies: 10
    Last Post: 03-05-2008, 08:28 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers