Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP loop - call JavaScript function

Status
Not open for further replies.

gmail2

Programmer
Jun 15, 2005
987
IE
I need to create a PHP loop which will update a MySQL db for each iteration of the loop. This isn't a problem. But what I'd also like to do after each record is inserted is call a JavaScript function. I thought about echoing <script ...> and calling the function that way, but that means that for each iteration of the loop (and there could be 1000's or iterations) that a new <script line would be gererated so making the file very big. I can't use Header: Location because then the PHP would no longer be processed anymore. So does anybody have any other ideas?
 
I don't understand. What JS function do you need to run so many times, why do you need to output it after every loop since it only executes when all the php processing is done and how would header location help. And if it would help, why can't you do inserts and then run header location, since inserting records seldom needs any output. And if you redirect, there's no point in output anyway.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top