MrBillybob Posted August 9, 2007 Share Posted August 9, 2007 When ever a user logs in i want to run a script that will loop trough 1000 items and put them into a db(this part is done). The script that loops takes awhile so i don't want it to make the user wait for it to finish. I don't need to get anything from the script i just need to have it run. Is this possible? Quote Link to comment https://forums.phpfreaks.com/topic/64005-solved-running-a-script-in-the-back/ Share on other sites More sharing options...
teng84 Posted August 9, 2007 Share Posted August 9, 2007 do it in separate page use ajax like when the user is loged it will pass a value on the other page to be looped Quote Link to comment https://forums.phpfreaks.com/topic/64005-solved-running-a-script-in-the-back/#findComment-319035 Share on other sites More sharing options...
MrBillybob Posted August 9, 2007 Author Share Posted August 9, 2007 i dont know how to use ajax... Quote Link to comment https://forums.phpfreaks.com/topic/64005-solved-running-a-script-in-the-back/#findComment-319038 Share on other sites More sharing options...
cmgmyr Posted August 9, 2007 Share Posted August 9, 2007 Can I ask what you are doing with that look that you need to do it 1000 times??? Quote Link to comment https://forums.phpfreaks.com/topic/64005-solved-running-a-script-in-the-back/#findComment-319041 Share on other sites More sharing options...
teng84 Posted August 9, 2007 Share Posted August 9, 2007 http://www.w3schools.com/php/php_ajax_database.asp simple and cool take a look Quote Link to comment https://forums.phpfreaks.com/topic/64005-solved-running-a-script-in-the-back/#findComment-319042 Share on other sites More sharing options...
MrBillybob Posted August 9, 2007 Author Share Posted August 9, 2007 i am getting a csv from a server and then updating records Quote Link to comment https://forums.phpfreaks.com/topic/64005-solved-running-a-script-in-the-back/#findComment-319046 Share on other sites More sharing options...
cmgmyr Posted August 9, 2007 Share Posted August 9, 2007 What do you need the csv for? Do you really need to update it that much? ...Why don't you just pull the information from the database when you need it instead of running this function all the time? It would certainly speed things up. Quote Link to comment https://forums.phpfreaks.com/topic/64005-solved-running-a-script-in-the-back/#findComment-319051 Share on other sites More sharing options...
MrBillybob Posted August 9, 2007 Author Share Posted August 9, 2007 ...the server provides a csv of the most recent data...so i get the csv file and insert the new rows into the database..and there wont be alot of traffic so i thought this would be the best way Quote Link to comment https://forums.phpfreaks.com/topic/64005-solved-running-a-script-in-the-back/#findComment-319054 Share on other sites More sharing options...
cmgmyr Posted August 9, 2007 Share Posted August 9, 2007 why would you write the data to the file, then the same data to the database? Can you write out your whole procedure for us...I'm sure we can give you a better solution Quote Link to comment https://forums.phpfreaks.com/topic/64005-solved-running-a-script-in-the-back/#findComment-319057 Share on other sites More sharing options...
MrBillybob Posted August 9, 2007 Author Share Posted August 9, 2007 i am getting it from another server...it is the only way i can get it Quote Link to comment https://forums.phpfreaks.com/topic/64005-solved-running-a-script-in-the-back/#findComment-319087 Share on other sites More sharing options...
cmgmyr Posted August 9, 2007 Share Posted August 9, 2007 do you have access to the database on the other server? Quote Link to comment https://forums.phpfreaks.com/topic/64005-solved-running-a-script-in-the-back/#findComment-319687 Share on other sites More sharing options...
Orio Posted August 9, 2007 Share Posted August 9, 2007 ignore_user_abort() Thats all. Orio. Quote Link to comment https://forums.phpfreaks.com/topic/64005-solved-running-a-script-in-the-back/#findComment-319697 Share on other sites More sharing options...
MrBillybob Posted August 10, 2007 Author Share Posted August 10, 2007 Thanks Orio. and cmgmyr the server is the EvE-Online(mmorpg) server so i dont have access to there database the only way they provide the file is in csv or xml. Quote Link to comment https://forums.phpfreaks.com/topic/64005-solved-running-a-script-in-the-back/#findComment-320494 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.