Welcome Guest, Not a member yet? Register   Sign In
Executing This Kind of SQL
#1

[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. Smile I love CodeIgniter.


Messages In This Thread
Executing This Kind of SQL - by El Forum - 06-28-2012, 11:23 AM
Executing This Kind of SQL - by El Forum - 06-28-2012, 11:43 PM



Theme © iAndrew 2016 - Forum software by © MyBB