vendredi 22 juillet 2016

How would I use ON DUPLICATE KEY UPDATE in my CodeIgniter model?

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

Aucun commentaire:

Enregistrer un commentaire