Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    Regular Coder
    Join Date
    Apr 2005
    Posts
    388
    Thanks
    0
    Thanked 0 Times in 0 Posts

    not sure where to post this one

    Howdy,
    I have a script that goes through and searches a mysql db, it currently has 16500 records, I get this error code-

    Fatal error: Maximum execution time of 30 seconds exceeded in e:\deduper.php on line 22

    I am running this on phpdev423, anybody know is this an apache error code? mysql? or php?
    the script seems to be running correctly because it finds 3 duplicates before the error code is displayed and the process stopped. Could it be a php problem? I will post the script if it will help.

    tia.

  • #2
    Regular Coder
    Join Date
    Feb 2005
    Location
    Texas
    Posts
    472
    Thanks
    1
    Thanked 0 Times in 0 Posts
    It means the php script takes too long. Change the max execution time in your php.ini.
    If you're reading this, it may already be too late!

  • #3
    Regular Coder
    Join Date
    Aug 2004
    Location
    The US of A
    Posts
    767
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Post the script. You could have a bad loop in there.

  • #4
    Regular Coder
    Join Date
    Apr 2005
    Posts
    388
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I must or just not checking efficiently, I currently have my execution timeout set to 3000 seconds and it dies out in the 18000 range somewhere.

    Code:
    $sql="SELECT * FROM agents ";
    $result = mysql_query($sql);
    $rows = mysql_num_rows($result);
    if($rows==0){echo"MySQL Error = ".mysql_error();} else {
    echo "There are a total of ".$rows." rows in the database."."<br />";
    }
    while($line= mysql_fetch_assoc($result)){
    $trec = $line['trec'];
    $uid = $line['uid'];
    
    $sql2="SELECT uid FROM agents WHERE trec = $trec";
    $result2 = mysql_query($sql2);
    $trecrows=mysql_num_rows($result2);
    if($trecrows > 1){echo $uid."<br />";}}
    what I am doing here, I pull everything out of the database into an array,
    I then iterate through the loop comparing a unique field with the same data in the array, is there a better way to do this, it just occurred to me that maybe if I created two arrays and compared them to each other it may go faster instead of using the db. any thoughts or suggestions would be appreciated.

    thanks.

  • #5
    Regular Coder
    Join Date
    Feb 2005
    Location
    Texas
    Posts
    472
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Well you said you have 16000+ records, it probably takes a while to pull them all out and it's going over the 30 second limit.
    If you're reading this, it may already be too late!

  • #6
    Regular Coder
    Join Date
    Apr 2005
    Posts
    388
    Thanks
    0
    Thanked 0 Times in 0 Posts
    well, when it said it found a duplicate in the 18000s, i wondered how that could be, I double checked there is actually 19500 records or rows whichever you prefer. but I have my timeout set to 3000 seconds which is 50 minutes, and I think that is still abit too long for the amount of data. am I wrong in thinking that way or should it take that long?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •