[eluser]JasonS[/eluser]
I don't think I am being stupid here.
Here is my code.
Code:
$db = array (
'content' => $this->ci->input->post('content'),
'seo_keywords' => $this->ci->input->post('seo_keywords'),
'seo_description' => $this->ci->input->post('seo_description'),
'seo_title' => $this->ci->input->post('seo_title'),
);
foreach($db as $field => $value) {
echo $value . '<br />';
$this->ci->db->where('name', $field)->where('page_id', $page->id)->set('value', $value)->update('page_fields');
echo $this->ci->db->last_query() . '<br />';
}
Only the content field has any input in it. This creates the following output.
Quote:Test
UPDATE `page_fields` SET `value` = 'Test' WHERE `name` = 'content' AND `page_id` = '1'
UPDATE `page_fields` SET `value` = 0 WHERE `name` = 'seo_keywords' AND `page_id` = '1'
UPDATE `page_fields` SET `value` = 0 WHERE `name` = 'seo_description' AND `page_id` = '1'
UPDATE `page_fields` SET `value` = 0 WHERE `name` = 'seo_title' AND `page_id` = '1'
Surely this should be `value` = ''?