| 
	
 | 
 Posted by anom on 09/06/05 23:41 
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. 
 
I'm guessing some sort of buffer problem (needs flushing?) but it is a  
guess. 
 
I'm running this all locally - XP, Apache2, PHP5, mySQL 4.1 
 
Keith
 
[Back to original message] 
 |