Hey there Roger,

I just put that in (Will keep it in anyway) but I get the same problem.  Could it be 
there's some kind of illegal char in one of the array fields?  If so, how can I do 
checking and fix bad characters when going through the array?  I know if I remove the 
LoDesc fields (Which is $data[15]; if I remember correctly) it imports over 880 
fields, but when that's in it only imports 92 - but I have no idea how to correct bad 
characters they may have put in the file (I have no control over the characters they 
use - sigh).

I really appreciate your help on this.


  may want to try this also (instead of stating a size)...



while ($data = fgetcsv ($fp, 10000, $d)) {Would be this:

while ($data = fgetcsv ($fp, filesize($userfile), $d)) {
  Let me know...

  Chris Payne wrote:

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);

$count ++;

mysql_query ("INSERT INTO import 

echo $count;

fclose ($fp);

Thanks for any help



...and I say unto you, the Geek shall inherit the earth.

Reply via email to