Код: Выделить всё
// Select the products
$query = $this->db->select('id,sku,name,image')
->from('products')
->get();
// !!! Here's where I need help - I need to loop through the results and run
// another query based on the ID which will pull a description from
// a number of possible sources and then add the resulting description into
// the main $query object so it can still use xml_from_result()
// Load the Database Utilities
$this->load->dbutil();
// Configure the xml structure
$config = array (
'root' => 'root',
'element' => 'element',
'newline' => "\n",
'tab' => "\t"
);
// Output the xml doc
header('Content-type: text/xml');
echo $this->dbutil->xml_from_result($query, $config);
Подробнее здесь: https://stackoverflow.com/questions/291 ... ery-result
Мобильная версия