Welcome Guest, Not a member yet? Register   Sign In
Using string replace function of mysql with CI active record class
#1

[eluser]Unknown[/eluser]
Hi everyone,

Here is a mysql query i have in my application:

Code:
UPDATE items SET item_name = REPLACE(item_name, 'ipod', 'iPod') WHERE item_name LIKE 'ipod%'

Note: This is not the exact sql query i am running. I have changed fields names and data for this example.

Is there a way for me to run this query with active record class. Something like:

Code:
$this->db->like('item_name', 'ipod', 'after');
$this->db->update('items', array('item_name' => "REPLACE(item_name, 'ipod', 'iPod')");

thanks...


Messages In This Thread
Using string replace function of mysql with CI active record class - by El Forum - 09-12-2009, 07:08 PM



Theme © iAndrew 2016 - Forum software by © MyBB