diamondtron Posted June 18, 2012 Share Posted June 18, 2012 Hi, I have a PHP script which runs for around 60 mins, It contains code somewhat similar below. while(loop through sql query results) { if(condition_check) echo "OK" else echo "Not OK" } The problem is i am getting the final output displayed on the page only after when the whole scripts finishs (~ 60 mins). What is want is as soon as condition is checked the result should be displayed and then it should move on to next iteration. I tried adding flush() but it doesnot work, Can anyone help me out. Thanks a lot in advance. Link to comment https://forums.phpfreaks.com/topic/264370-script-results-only-shown-after-whole-script-execution/ Share on other sites More sharing options...
Kieran Menor Posted June 18, 2012 Share Posted June 18, 2012 Maybe output buffering is enabled? Try calling ob_flush() before flush() Link to comment https://forums.phpfreaks.com/topic/264370-script-results-only-shown-after-whole-script-execution/#findComment-1354789 Share on other sites More sharing options...
diamondtron Posted June 18, 2012 Author Share Posted June 18, 2012 Thanks, Yes, outbut buffering was on, I changed the setting to "off", now its working fine. Link to comment https://forums.phpfreaks.com/topic/264370-script-results-only-shown-after-whole-script-execution/#findComment-1354797 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.