Jump to content

Show running result of array creation


paruby

Recommended Posts

I am creating an array from data from a mssql SELECT statement. I have a total of 530 rows of data returned that I am then inserting into an array. I want the screen to update the number of rows added to the array, so it loks like an rolling update, ie. print: "1 of 530 rows added"; then print: "2 of 530 rows added"... print "530 of 530 rows added". But I want it to "overwrite" the previous line so it looks like the fisrt number is changing... Seems easy, but can it be done?

Thanx
Pete
Link to comment
https://forums.phpfreaks.com/topic/3954-show-running-result-of-array-creation/
Share on other sites

Is this a web page or a command line script? You can't do that with a web page. On the command line you may be able to use fseek() and fwrite() on STDOUT. I've never tried it though. Make sure it's automatically flushing output.

You can also try clearing the screen with a system command just before a write.
If it's a really long process, you probably don't want to make your user(s) wait. You should be able to send them to an intermediate page while they wait, one with an animated gif or something, and set it to redirect to a "completed" page after a period of time.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.