【发布时间】:2016-07-10 01:37:59
【问题描述】:
想要加密特定数据变量但不断收到“PHP 致命错误:调用未定义函数 AES_ENCRYPT()...”
研究提示我使用的是 PHP 而不是 MySQL?
$key="xyz";
$stmt = mysqli_prepare($mysqli, "INSERT INTO details (FirstName, LastName, EncryptThis) VALUES (?,?,?)");
if ($stmt === false) {
trigger_error('Statement failed! ' . htmlspecialchars(mysqli_error($mysqli)), E_USER_ERROR);
}
$bind = mysqli_stmt_bind_param($stmt, "sss", $FirstName, $LastName, AES_ENCRYPT('$EncryptThis','$key'));
if ($bind === false) {
trigger_error('Bind param failed!', E_USER_ERROR);
}
$exec = mysqli_stmt_execute($stmt);
我在数据库中使用 varbinary...
尝试过各种用途
AES_ENCRYPT('$EncryptThis','$key')
EG
AES_ENCRYPT($EncryptThis,$key)
等等等等
【问题讨论】:
-
谢谢@rjdown,在研究过程中发现了这个......