Here is the code that I use:
Code:
$where = "SELECT * FROM table WHERE ".$this->DB->quoteInto('user = ? ', $this->user['id']);
$where .= " AND ".$this->DB->quoteInto('blocks LIKE ? ', $block);
$row = $this->DB->fetchRow($where);
// Change the value of the blocks columns
$rowBlocks = split(',', $row->blocks);
foreach ($rowBlocks as $value)
{
if($block != $value)
{
$blockArray = $value;
}
}
$row->blocks = $blockArray;
// UPDATE the row in the database with new values
$row->save();
As mentioned before, PHP tells me that the variable $row is not an object....shouldn't it be one??