【发布时间】:2015-02-05 12:19:11
【问题描述】:
我正在尝试更新数据库中的配置文件而不将配置文件 ID 作为参数传递,而不是更新我正在添加新行。我尝试使用 getLastInsertId() 但它不起作用。
public function editProfile(){
if (isset($this->data)){
$Client = $this->Client->find('first', array(
'fields' => array('email','username','first_name','surname','country','phone_prefix','phone'),
'conditions' => array(
'Client.email' => $this->request->query['email'],
'Client.client_type' => $this->request->query['client_type']
),
)
);
if($this->request->is('get')) {
if($data = $this->Client->save($this->request->query,array('first_name','surname','country','phone_prefix','phone')))
{
$this->Client->id = $this->Client->getLastInsertId();
【问题讨论】:
标签: cakephp cakephp-2.0 cakephp-1.3 cakephp-2.3