1
我是新的代碼點火器數據映射器。我有一個名爲user的表,我試圖從數據庫表中檢索數據並將它們顯示給用戶。 這裏是我的模型:如何在DataMapper Code Igniter中顯示get_by_user_id()返回的數據?
$u=new User();
$results=$u->get_by_user_id($id);
//$results here will be set to huge bunch of none sense data(which also includes the row that I am looking for as well)
if ($u->exists())
{
foreach ($results->all as $row){
$data['user']['first_name']=($row->user_first); //this where I am stuck ..
$data['user']['last_name']=($row->user_last);//this is also where I am stuck..
}
我不知道如何對待結果得到一個必填字段我要找並將它們儲存在我傳遞給用戶來查看數據$ 。 謝謝!
非常感謝它的作品@Armon Toubman! – 2012-02-01 20:01:28