Zend_Db issue with fetchAssoc
Posted: Tue Dec 08, 2009 11:56 am
I have the following code:
I am getting the following results:
The error here (if not obvious) is that I am selecting a single record and should be able to return the details like:
Which I cannot do because the index is ONE???
What am I doing wrong?
Cheers,
Alex
Code: Select all
//$this->db->setFetchMode(Zend_Db::FETCH_OBJ);
$results = $this->db->fetchAssoc('SELECT * FROM sites WHERE id = ?', 1);
Code: Select all
Array
(
[1] => Array
(
[id] => 1
[name] => default shop
[description] => Default shop.
[base_url] => http://localhost/
[warehouse_filters_enabled] => 0
[category_filters_enabled] => 0
[view_directory] => default
[app_folder] => shop_main
[session_name] => shopmain
[is_down] => 0
[down_time_msg] =>
[enable_cutomer_category_filters] => 1
)
)
Code: Select all
return $results[0];What am I doing wrong?
Cheers,
Alex