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)
精彩评论