Hi there everyone,

OK So I kind of have my CSV utility working nicely, except for one thing - if I import 
the file with PHPMyADMIN it imports over 1000 rows (Which is correct) but with the 
below code on the same file, it's only importing 92 rows, can anyone see anything 
obvious that's wrong?  I think it could be the MySQL query, as I have a count 
statement which counts the number of rows in the loop and it counts correctly and if I 
print the data on the screen it prints the data correctly, just when it writes to the 
DB argghhh i'm going nuts, i've been trying hard to figure it out without hasstling 
the group (Sorry).

$d = "|"; // fields delimiter
$fp = fopen ($userfile, "r");
while ($data = fgetcsv ($fp, 10000, $d)) {
  $num = count ($data);
   $row++;

$count ++;

mysql_query ("INSERT INTO import 
(id,BranchReference,address1,Location,Location2,Postcode,Price,Offers,Bedrooms,Receptrooms,period,Proptype,spare1,Propstatus,ShortDescription,LoDesc,PictureRef1,Bullets,Field1,Field2,Field3,Field4,Field5,Field6,Sale)
 
              VALUES 
('$data[0]','$data[1]','$data[2]','$data[3]','$data[4]','$data[5]','$data[6]','$data[7]','$data[8]','$data[9]','$date[10]','$data[11]','$data[12]','$data[13]','$data[14]','$data[15]','$data[16]','$data[17]','$data[18]','$data[19]','$data[20]','$data[21]','$data[22]','$data[23]','$data[24]')
 ");

};
echo $count;

fclose ($fp);

Thanks for any help

Regards

Chris

Reply via email to