0

Order task on per image.

- check image exist
- create thumbnail
- save information of images and thumb to database

If we do it with very more images and need more time to execute request than default of php (30s)

Does the time contain php execution time + mysql time ? or only time for php ?

When i save information ,some images missing infor when still insert to database

example : with 30 images

php : scan information of 25 images 
mysql: insert 30 images infor

i think php process time exceed to default time , request will be stop. so mysql only insert 25 images infor. That right ?

$infor 

if (// create thumb and get infor successfull) // if exceed time , why script don't stop inserting infor
{
   $infor return information of images
}

$database->insert($infor)

what i want to know is when script will be stop. if process is create thumb step and be stopped by exceed time, why script continue insert null infor to database

4
  • 3
    Possibly. Why don't you increase the time limit and see if the problem goes away? Commented Jul 14, 2011 at 2:21
  • what i want to know is when script will be stop Commented Jul 14, 2011 at 2:44
  • The script will not continue to insert null data to a database after it has stopped, or it's not stopped. If you are getting null data in your database it's because your code is wrong. Commented Jul 14, 2011 at 3:11
  • I'm checking my code.... Commented Jul 14, 2011 at 4:53

2 Answers 2

1

You can increase time in .ini files or code like this

ini_set('max_execution_time', 300); //300 seconds = 5 minutes

Or use set_time_limit function on PHP.

http://php.net/manual/en/function.set-time-limit.php

Sign up to request clarification or add additional context in comments.

1 Comment

what i want to know is when script will be stop. if process is create thumb step and be stopped by exceed time, why script continue insert null infor to database
0

in such cases use

set_time_limit(0);

0 means unlimited . Use this function on top of your php file which can take long time .

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.