2010-04-29 82 views

回答

0

如果它在数据库中,当你到达下一个表单时,只需在控制器中再次读出它并将其设置为视图变量。

$this->set('lastid', $this->Model->read(null,$id)); 

或者,如果您需要在数据库中搜索现场使用发现

$this->set('lastid', $this->Model->find('first', array('conditions'=>array('username'=>'MyUserName')) , array('id'))); 

你可以去周围使用mysql_insert_id()

+0

谢谢!很简单,我在想太多。 – junior29101 2010-04-29 21:32:29

+0

我不会使用mysql_insert_id()。它不是便携式的,上班时会很笨重。假设您甚至可以从ConnectionManager获取连接资源。 – 2010-04-29 21:51:03