开发者

CakePHP: findByEmail() function returns an array

开发者 https://www.devze.com 2023-03-19 04:41 出处:网络
I have a database table Users with an id column \"uid\" and an email column \"email\".I am executing this line of code:

I have a database table Users with an id column "uid" and an email column "email". I am executing this line of code:

$user = $this->User->findByEmail($this->data['User']['email']);

Where $this->data['User']['email'] is unquestionably returning the correct email address and this email address is in the database table. However, the result of:

echo "User is :" . $user = User is开发者_如何转开发: Array

I need to know how to get the value of the id out of this array.

Any advice is appreciated.

Regards.


try $user[0] or print_r($user)

0

精彩评论

暂无评论...
验证码 换一张
取 消