CakePHP 2.x how to store encrypted data in mysql?

I am working on a Cakephp 2.6 I’m trying to encrypt my data which i am storing into db
For example i have a function in controller which is saving data:

$data = $this->request->data;
$data['card_serial'] = Security::encrypt($data['card_serial'], SECURITY_CODE);

And view, I’m trying to decrypt:

<td> <?php echo Security::decrypt($record['Card']['card_serial'], SECURITY_CODE); ?> </td>

I have done this but didnt work

Error: [CakeException] The data to decrypt cannot be empty.

You’ve probably already tried this, but just in case, make sure the data you expect is actually there, getting saved, and coming back out:

after your save:

and in your view, again: