$table='tab'; $del=mysql_query("TRUNCATE TABLE `".$table."`"); $fp = fopen ("base.csv","r"); while ($data = fgetcsv ($fp,0,";")) { $num = count ($data); for ($c=0; $c < $num; $c++) { if ($del=false){break; echo 111;} $result=mysql_query('insert into tab (id1,id2,a3,a35,a5,p2,p3,p4,6a6,hf3) values ("'.$data[$c].'","'.$data[$c+1].'","'.$data[$c+2].'","'.$data[$c+3].'","'.$data[$c+4].'","'.$data[$c+5].'","'.$data[$c+6].'","'.$data[$c+7].'","'.$data[$c+8].'","'.$data[$c+9].'")'); $c=$c+9;}} fclose ($fp); From the csv file, fewer lines are inserted into the database than, actually, there is in the file. When importing 13000+ through phpmyadmin and with this 10980. Tell me, am I doing something wrong, or can there be easier ways?