inserting data into mysql

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I have a simple loop
     include '../php_library/connect.php';
     include '../php_library/opendb.php';

     $conn=mysql_connect($host,$dbuser,$dbpass) or die ('Error');
     //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)){

It works fine for the first couple of hundred or so rows but the stops -  
no errors, it just stops mid-loop.

I'm guessing some sort of buffer problem (needs flushing?) but it is a  

I'm running this all locally - XP, Apache2, PHP5, mySQL 4.1


Re: inserting data into mysql

Quoted text here. Click to load it

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...

Met vriendelijke groeten,
Tim Van Wassenhove <

Re: inserting data into mysql

Tim Van Wassenhove wrote:
Quoted text here. Click to load it
  Thank you - spot on

Site Timeline