Re: a LITTLE bug with my CSV importer :-)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Chris --

...and then Chris Payne said...
% 
% Hi there everyone,

Hi!


% 
% 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

:-D
-- 
David T-G                      * There is too much animal courage in 
(play) davidtg@xxxxxxxxxxxxxxx * society and not sufficient moral courage.
(work) davidtgwork@xxxxxxxxxxxxxxx  -- Mary Baker Eddy, "Science and Health"
http://justpickone.org/davidtg/      Shpx gur Pbzzhavpngvbaf Qrprapl Npg!

Attachment: pgp00079.pgp
Description: PGP signature


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux