2010-02-03 83 views
0

我無法從doctrine獲取最後一個插入標識的值。我做了一些研究,我發現下面應該工作:php基本數組問題

//save the store now 
$store = new Store(); 
$store->url = $this->form_validation->set_value('website'); 
$store->save(); 
$store_id = $store->identifier(); 

echo print_r($store->identifier()); 

返回

Array ([id] => 1000034) 

我怎麼拉剛值(1000034)從數組中,並設置一個變量我可以在其他地方使用?

回答

5

$store_id是一個關聯數組由「ID」,這樣鍵合的單個值:

$id = $store_id['id'];