On Sun, 16 Aug 2009 04:15:12 +0300, Devendra Jadhav <devendra...@gmail.com> wrote:

Is it because of the size of the records or something else...?

Please suggest me some solution which is faster, safe and easy to code :D

What about using insert ignore ? :)

1. add UNIQUE constraint on a key you want to add, so you won't be able to add row with same ID twice.
2. then use INSERT IGNORE into ....

=> easy to code, easy to use.

Of course, this aproach won't work if database will grow larger and larger. (if you adding new rows all the time)

Then it is better to use this aproach:

1. add auto_increment column to original table.
2. before getting new rows from old table, check what is maximum ID from new table. 3. get only rows where old_table.id > new_table.max_id remember to ORDER BY ID ASC.


PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to