![]() |
SELECT and UPDATE
I am wondering how to design a certain transaction process i want to build into my website and am looking for any guidance people have.
I have a website which accepts rental enquiries onto a table. I've been emailing out the enquiries to around 60 email addresses as they are submitted into an html form on the site and also updating the mysql table. As the number of emails i have to send grows i realise i want to create a cron job to send the mails now. As the enquiries are added to the mysql table i want to set a status column to A for "awaiting posting". I then want the cron job to pick up all status A enquiries and send out emails whilst setting the status on the table to P for "posted." Query i have is how do i cater for the fact that enquiries may be coming in as i am reading the table making this prone to issues. What is the best way to handle this scenario? Thanks, Ewan |
you can either use your own crown system for your server. Or use the good old fork to spawn an extra thread to work on those emails while. Or use the Gearman system/library which main role is to help do parallelism easier in PHP
|
w3school site have a many tutorial with example.
|
You can refer the W3school or Google your problem and you will get your solutions. In the mean time, I will also help you solve your problem.
just saying |
| All times are GMT. The time now is 03:01 PM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0