Go Back   CodingForums.com > :: Server side development > MySQL

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-15-2002, 09:22 AM   PM User | #1
MAtt
New to the CF scene

 
Join Date: Jun 2002
Location: small town saskatchewan
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
MAtt is an unknown quantity at this point
How do I avoid max execution time errors?

Hi, I am writing a script to enter product descriptions into a database. The code used to do this is as follows:
PHP Code:
    while(list($key$val) = each($descriptions)) {    
      
$description explode("," "$descriptions[$key]");
      
$description[1] = htmlspecialchars("$description[1]",ENT_QUOTES);
      
$sql "UPDATE products SET " .
            
"Description='$description[1]' " .
            
"WHERE ProductID='$description[0]'";
      
$query mysql_query($sql) or die(mysql_error());
    } 
The trouble is, i get an error: "Fatal error: Maximum execution time of 30 seconds exceeded in..."
Is there a way I can adjust my code to get rid of this error?
My only idea is to split the descriptions.txt file into multiple files and enter each file into the database separately and I don't think the max execution time can be changed.
Thank you,
Matthew Ruten
MAtt is offline   Reply With Quote
Old 10-15-2002, 01:41 PM   PM User | #2
Ökii
Regular Coder

 
Join Date: Jun 2002
Location: UK
Posts: 577
Thanks: 0
Thanked 0 Times in 0 Posts
Ökii is an unknown quantity at this point
If you are very confident of the integrity of your code (ie, you are sure the max execution time is surpassed just due to size of update rather than an awkward for loop)...


ini_set(max_execution_time,900);

would give you 15 minutes.

Note: Many hosts will disable client use of ini_set();
__________________
Ökii - formerly pootergeist
teckis - take your time and it'll save you time.
Ökii is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:59 AM.


Advertisement
Log in to turn off these ads.