View Single Post
  #2 (permalink)  
Old 11-19-2007, 11:40 PM
socceroos socceroos is offline
Junior Member
 
Join Date: May 2007
Posts: 9
Default

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??
Reply With Quote