views:

68

answers:

1

Hi folks!

I have a CodeIgniter/PHP Model and I want to insert some data into the database.

However, I have this set in my 'raw' SQL query:

ON DUPLICATE KEY UPDATE duplicate=duplicate+1

I am using CodeIgniter and am converting all my previous in-controller SQL queries to ActiveRecord. Is there any way to do this from within the ActiveRecord-based model?

Thanks!

Jack

A: 

This script is pretty nifty: http://codeigniter.com/forums/viewthread/80958/

(try the one at the very bottom. Haven't tried it myself but it looks alright)

Calle