Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
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)
Old 11-16-2012, 05:26 PM   PM User | #17
nani_nisha06
Regular Coder

 
Join Date: Oct 2012
Location: mother land --india
Posts: 159
Thanks: 37
Thanked 2 Times in 2 Posts
nani_nisha06 is an unknown quantity at this point
Quote:
Originally Posted by Fou-Lu View Post
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.

Thanks will try it and will post the results...
nani_nisha06 is offline   Reply With Quote
Old 11-17-2012, 05:02 PM   PM User | #18
nani_nisha06
Regular Coder

 
Join Date: Oct 2012
Location: mother land --india
Posts: 159
Thanks: 37
Thanked 2 Times in 2 Posts
nani_nisha06 is an unknown quantity at this point
Quote:
Originally Posted by Fou-Lu View Post
PHP Code:
$iSuccessful += mysql_affected_rows($result); 
.
Fou-Lu,

These suggestion worked like a charm with some personal customization....

Really thanks full on your support....

Regards,
Nani
nani_nisha06 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:10 PM.


Advertisement
Log in to turn off these ads.