我是 Cakephp 的新手,所以我觉得很难实现数据库查询.. 我想要更新一个手机号码,其中电子邮件等于用户提供的号码.. 这是我想要实现的查询
"Update Users set mobileNo = $mobileNo where email = $email"
我正在这样做
$mobileNo = $data['mobileNo'];
$email = $data['$email'];
$count = $this->User->find('count', array(
'conditions' => array('User.email' => $email)));
if($count>0){
$email = $this->User->field(
'email',
array('User.mobileNo' => $mobileNo));
echo $email;
$this->User->saveField("mobileNo",$mobileNo);