I'm running php site having sql server database. I've given facility to generate excel report having large data in that. Now is there any way such that, if one user requests for report, then the query for that report should run in background mode in sql server & may be creating temporary table, then after 10-15 min, if query is executed, user will be able to download report from there. Suppose, if user "xyz" request for excel report & the query required to generate report is "abc", the query will be running in background mode of sql server but not in php, means I dont want to execute mssql_query, so after completion of query execution, I can directly get the data from the result of "abc" query. This is just one of my idea, so is this possible to do in php else please let me know if you've any other ideas? Thanks in advance. Vijay
Yea you already have an idea of exactly how to do it, it could work just like an emailQueue This is how I'd do it: 1. User requests report -> report is added to a reportQueue table 2. Cron job runs and checks reportQueue table if there is any it executes it 3. report added to temp table -> user is notified.
1) You can create a daemon on the server, who checkes every 15-20 seconds to see any report request has been generated (you will write these requests on the frontend to sql server) and fulfills them. 2) You can place an Ajax request on the front end. Ajax request will query the background every 5 seconds to check if the request has been completed. (If you ever searched for flight prices in Priceline or Orbitz, similar technology is used in such places)