Welcome Guest, Not a member yet? Register   Sign In
Append value to database field
#1

[eluser]mvdg27[/eluser]
Hi,

I'm not sure if this is directly CI related, or has to do more with SQL queries in general .. anyway, I'm trying to append a value to a certain field, like so:
Code:
$where = 'id IN ('.$data['related'].')';                
$this->db->where($where);
$this->db->set('related', 'related,'.$this->db->insert_id());
$this->db->update('artists');

The correct rows are updated, but instead of appending, the current value get's overwritten with the string 'related'. Which makes sense, but I have no clue how to do this any other way ..

Anyone have an idea?

Thanks!
#2

[eluser]Derek Allard[/eluser]
Could you give an example of the SQL you want to see output?




Theme © iAndrew 2016 - Forum software by © MyBB