我想從表中選擇一個特定的列,並返回結果作爲一個簡單的數組。我有以下代碼Zend返回爲數組
$select = $this->select();
$select = $select->from($this,array('DISTINCT(conversation_id)','conversation_id'))
->where('user_id =?',$user_id);
return $this->fetchAll($select)->toArray();
問題是,返回的結果是2D。所以如果我想得到結果,我必須去$result[0]['conversation_id']
。我怎麼才能得到它,所以我只需要鍵入$result[i]
?
感謝
爲什麼使用數組,爲什麼不使用對象:'$ result-> conversation_id',只是一個想法。 – RockyFord