I will try be clear and specific 🙂
So i have a website, where people purchase stuff from each other.
To keep everything organised, when someone buys something from another user, That purchase will be moved to a table in database, called Pending. (Note: The purchased is not processed yet)
(so all purchases will be moved and queued into this ‘Pending’ table)
Now what I want to do is, that this table ‘Pending’, starts processing 1 purchase at a time automatically (let’s say 1 purchase every one minute –> if there are any ofcourse).
Now I have no idea how to do this, if someone can atleast give me a hint on what can I use or what to look for, in order to do this.
Note: am using php & mysql
Thanks in advance 😀 🙂
You can write a PHP script to be executed by a cron job. PHP doesn’t have to be executed from a browser request, it can be run form the command-line. Cron would make use of this functionality.
The crontab line to execute a command every minute would be as follows:
Each column has a
*indicating “any value”, so this indicates to run the script “any minute, any hour, any day, any month, any day of week”