I'm trying to use AES_ENCRYPT AND AES_DECRYPT, I do get a string of random characters in the MYSQL data field but can't return anything with the AES_DECRYPT
My table field for password is setup as VARBINARY, 600 Length.
ADDING INTO THE DATABASE I HAVE:
mysqli_select_db( $connection , $databaseName );
$request = '
UPDATE person
SET firstName = AES_ENCRYPT("Fred","key123")
WHERE ID="34"';
$result = mysqli_query( $connection , $request );
SELECTING FROM THE DATABASE I HAVE:
mysqli_select_db( $connection , $databaseName );
$request = "SELECT AES_DECRYPT(firstName, 'key123') FROM account WHERE ID = 34";
$result2 = mysqli_query($connection , $request);
$row = mysqli_fetch_array($result2);
$firstName = $row['firstName'];
echo $firstName;
This just returns nothing. Can anyone tell me where I'm going wrong? Thanks!