I am trying to use AES_ENCRPYT to encrypt some sensitive data in a MySQL database which needs to be able to be decrypted to allow a user to update the data later.
I am using the below syntax in PHPMyAdmin initially but, while I get a 1 row(s) inserted message, the field value is blank - any idea what I am doing wrong?
INSERT INTO table (field_name) VALUES (AES_ENCRYPT('text','password'))
The table and field in question is configured as:
CREATE TABLE IF NOT EXISTS `table` (
`id` int(5) NOT NULL auto_increment,
`field_name` varchar(200) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=28 ;
I am using PHPMyAdmin version 3.3.9 with MySQL version 5.0.92 and PHP version: 5.2.6 on Linux.