[eluser]PhilTem[/eluser]
If I got your problem right, it would be easier for you to run a slightly different query with help of the CI user's guide
[quote author="CI user's gudie" date="0"]
set() will also accept an optional third parameter ($escape), that will prevent data from being escaped if set to FALSE. To illustrate the difference, here is set() used both with and without the escape parameter.
Code:
$this->db->set('field', 'field+1', FALSE);
$this->db->insert('mytable');
// gives INSERT INTO mytable (field) VALUES (field+1)
$this->db->set('field', 'field+1');
$this->db->insert('mytable');
// gives INSERT INTO mytable (field) VALUES ('field+1')
[/quote]
That means for your code:
Code:
$this->db->set('banner', 'banner + 1', FALSE);
$this->db->where('id', $row['id']);
$this->db->update($table);
and it should run over and over and over again without stopping at $row['banner'] == ( 1 OR 2 ) (for 'I don't even know the reason why'
)