[eluser]IanMcQ[/eluser]
I'd like execute this kind of SQL code in a CodeIgniter method:
Code:
SET @uids := '';
UPDATE table_name
SET some_col= 'some_val'
WHERE some_col= 'some_val'
AND ( SELECT @uids := CONCAT_WS(',', @uids, id) );
SELECT TRIM(LEADING ',' FROM @uids);
The issue is that $this->db->query() doesn't play friendly with this kind of SQL (for obvious reasons). How might I go about executing this "routine" through CodeIgniter's database library? I'm not familiar enough with CodeIgniter's Active Record to know myself.
Thanks in advanced.
I love CodeIgniter.