Jump to content

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.
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.