Re: [PHP-DB] csv file with mysql

2001-03-12 Thread Ron Brogden

At 04:05 PM 3/12/2001 -0600, you wrote:
I'm loading a csv text file into a table in a mysql database, however it
seems to just stop after a while if the file is to big.
I'm new with php so any help would be appreciated.

PHP scripts will normally have a limited life span set in the server's 
config file (php.ini).  I think the default is 30 seconds but it could be 
anything.  What is most likely happening is that you are hitting the 
maximum execution time and thus your script gets killed off because of it. 
The only work around is to use a smaller CSV file or up the maximum 
execution time.  Keep in mind that a longer execution time means that 
errant scripts will be able to tie up resources for longer as well so do 
not set it to something crazy.

=)

Or if you have the appropriate file level access, just use "LOAD DATA 
INFILE" from within MySQL to do the import instead which will use less 
resources and not be subject to the same timeout issue.

Cheers,

Ron

-
Island Net AMT Solutions Group Inc.  Telephone:  250 383-0096
1412 Quadra  Toll Free:1 800 331-3055
Victoria, B.C.   Fax:250 383-6698
V8W 2L1  E-Mail:[EMAIL PROTECTED]
Canada   WWW:   http://www.islandnet.com/
-


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DB] csv file with mysql

2001-03-12 Thread Phil Driscoll

Looks like your script is hitting max execution time, as has already been
pointed out.

Rather than increasing the max execution time in php.ini, you can just call
set_time_limit(time in seconds, or 0 for no limit)
which will increase the execution time for just this script, thereby
minimising the possibility of being caught out by errant scripts running
away with your machine.

Cheers
--
Phil Driscoll
Dial Solutions
+44 (0)113 294 5112
http://www.dialsolutions.com
http://www.dtonline.org


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]