You are here: Re: inserting data into mysql « PHP Programming Language « IT news, forums, messages
Re: inserting data into mysql

Posted by anom on 09/07/05 00:31

Tim Van Wassenhove wrote:
> On 2005-09-06, anom <anommail@hotmail.co.uk> wrote:
>
>>I have a simple loop
>> include '../php_library/connect.php';
>> include '../php_library/opendb.php';
>>
>> $conn=mysql_connect($host,$dbuser,$dbpass) or die ('Error');
>> mysql_select_db($dbname);
>> //Open the file
>> $fp = fopen($src,"r");
>> //for each line in the file
>> while ($row=fgetcsv($fp,10000,';')) { //Get line
>> $sql_insert="INSERT INTO ...";
>> if (!mysql_query($sql_insert,$conn)){
>> OutputError($sql_insert,$mysql_error());
>> $FailedCount++;
>> }
>> else {$InsertCount++;}
>> }
>>
>>
>>It works fine for the first couple of hundred or so rows but the stops -
>>no errors, it just stops mid-loop.
>
>
> Prepend the following to your script:
>
> ini_set('error_reporting', E_ALL);
> ini_set('display_errors', TRUE);
>
> I've got a feeling you will see a message like: max execution time has
> been exceeded... http://www.php.net/set_time_limit
>
>
Thank you - spot on

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация