View Single Post
Old 11-16-2012, 03:06 PM   PM User | #16
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,635
Thanks: 4
Thanked 2,448 Times in 2,417 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
I don't believe that MySQL tracks a rejection option for an insert ignore. What you can do is pull the number that was successful after the result:
PHP Code:
$iSuccessful += mysql_affected_rows($result); 
And initialize $iSuccessful to 0 before the while loop, and you can compare the $iSuccessful to the $counter. $counter should represent the total number of records, while $iSuccessful should indicate the number inserted.
You should consider blocking the query into sets of even 10 entries at a time to save the query counts. Depending on the datasize you could potentially get away with hundreds of entries per query.
Fou-Lu is offline   Reply With Quote
Users who have thanked Fou-Lu for this post:
nani_nisha06 (11-17-2012)