Chris --

...and then Chris Payne said...
% 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).

The first thing that comes to mind is to check the PHPMyAdmin code to
see how they do a CSV import and steal that code :-)

The second thing is, since you suspect your mysql query, to just read
in the file and verify your count without trying to do anything with the
data; if you get all 1k rows then you don't have to worry about your
input mode.  If you don't get all of the rows, then see if you really
read the whole file and either stopped early or skipped over some, and
check those rows for problems.  [You haven't shown us sample data -- no,
I don't want all thousand rows! -- so it's tough to be more specific.]

Don't think of it as hassling the group; think of it as coming for help :-)
It's why we're all here!

HTH & HAND & good luck

David T-G                      * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, "Science and Health"      Shpx gur Pbzzhavpngvbaf Qrprapl Npg!

Attachment: pgp00000.pgp
Description: PGP signature

Reply via email to