Previous Thread
Next Thread
Print Thread
Rate Thread
#225728 10/02/2002 11:46 AM
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.

Sponsored Links
#225729 10/02/2002 12:57 PM
Joined: Dec 2000
Posts: 1,471
Addict
Addict
Offline
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.


Link Copied to Clipboard
Donate Today!
Donate via PayPal

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.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Bill B
Bill B
Issaquah, WA
Posts: 87
Joined: December 2001
Forum Statistics
Forums63
Topics37,575
Posts293,931
Members13,824
Most Online6,139
Sep 21st, 2024
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,834
Greg Hard 4,625
Top Posters(30 Days)
Gizmo 1
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2025 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.1
(Snapshot build 20240918)