|
|
Joined: Jun 2002
Posts: 303
Enthusiast
|
Enthusiast
Joined: Jun 2002
Posts: 303 |
I finally finished writing a script to convert my cyboards forum database over to threads, however, during my tests the script would time out on some occasions and others not.
Fatal error: Maximum execution time of 30 seconds exceeded in f:\foxserv\www\cyboards2threads.php on line 118
The database has 5500 records, so I figured there were a total of around 20,000 queries if my math is right.
Is there a way around this, or maybe a way I can put some sort of pause in the script to stop after so many seconds and then pick up where it left off in my loop sequence?
Thanks ahead of time for any help.
|
|
|
|
Joined: Dec 2000
Posts: 1,471
Addict
|
Addict
Joined: Dec 2000
Posts: 1,471 |
First workaround: Set the maximum execution time to a higher value (see your php.ini file)
Second workaround: Make some kind of loop in your script. Only convert 500 records, store the current position i a variable,reload the script and let it start at record 501 ....
|
|
|
|
Joined: Jun 2002
Posts: 303
Enthusiast
|
Enthusiast
Joined: Jun 2002
Posts: 303 |
Thanks. I talked to a programmer at work and he suggested something similar by adding a new column called flag to the old db, set the default as 0 and then when I select from the db, select those that are 0. As each record is added, set flag to 0 in the old db. When the script times out, just run it again and again, until it goes through the whole db.
It looks like your idea may be easier though. I'll give it a whirl first. Thanks.
|
|
|
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
|
|
Posts: 87
Joined: December 2001
|
|
Forums63
Topics37,575
Posts293,931
Members13,824
|
Most Online6,139 Sep 21st, 2024
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|
|