NYCPHP Meetup

NYPHP.org

[nycphp-talk] MySQL question

Hans Zaunere hans at nyphp.org
Fri Nov 15 14:34:36 EST 2002


--- tom at supertom.com wrote:
> I'm using the LOAD DATA query to load a file into a table, which is working
> OK.  I would like to know if anyone has figured out a way to receive
> statistics about this query, mainly how many and which rows where skipped.
> According to this page:
> 
> http://www.mysql.com/doc/en/LOAD_DATA.html

They speak of mysql_info() which is available in PHP.  It was requested by
yours truly months ago, however it still doesn't look like it'll be available
until 4.3. 

> there doesn't seem to be a way to do this easily.  I guess I can count the
> number of records in my file, and compare against the database to obtain
> the number of records skipped, and I could probably do a SELECT OUTFILE and
> compare that file with my original file to see which records were not
> loaded, but this seems like alot of work for what I'm asking for.

There are a couple built-in MySQL variables (which escape me at the moment)
that might help, but essentially, yes, you'd probably be best off doing it
the hard way (or use a CVS of PHP).  This is why I requested mysql_info() be
available  :)



=====
Hans Zaunere
New York PHP
http://nyphp.org
hans at nyphp.org



More information about the talk mailing list