CodeIgniter Forums
REPLACE INSERT/IGNORE in Active Record - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: REPLACE INSERT/IGNORE in Active Record (/showthread.php?tid=9047)



REPLACE INSERT/IGNORE in Active Record - El Forum - 06-10-2008

[eluser]kanuj[/eluser]
Is there an implementation of replace/insert ignore in active record in codeigniter? I wish to skip duplicate rows while insertion into a table.

Thank You.


REPLACE INSERT/IGNORE in Active Record - El Forum - 06-10-2008

[eluser]Derek Allard[/eluser]
Not part of active record, however you could write your own queries and CI would happily parse them.


REPLACE INSERT/IGNORE in Active Record - El Forum - 06-10-2008

[eluser]kanuj[/eluser]
Thanks Derek, I was hoping to avoid native queries in my app., but since IGNORE/REPLACE are native to MySQL, I'll make do with a native query. Thanks for the reply.


REPLACE INSERT/IGNORE in Active Record - El Forum - 06-10-2008

[eluser]Derek Allard[/eluser]
Yeah, and that's the problem with including them in AR, although you are not the first to mention it. Happy igniting!