嗨,大家好我需要帮助SQLite - sqlite_escape_string()在PHP中。 下面是一个代码:致命错误:调用PHP中未定义的函数sqlite_escape_string()
<?php
require_once('AES/AES_Encryption.php');
require_once('AES/padCrypt.php');
$database = new PDO('sqlite:example_sqlite3.db');
$key = "bac09c63f34c9845c707228b20cac5e0";
$iv = "123456789";
$AES = new AES_Encryption($key, $iv);
$Col1 = '123456789qwerty';
$Col2 = 'qwerty123456789';
$encrypted_1 = sqlite_escape_string($AES->encrypt($Col1));
$encrypted_2 = sqlite_escape_string($AES->encrypt($Col2));
INSERT INTO AES_T (encrypted_1 , encrypted_2) VALUES ('$encrypted_1', '$encrypted_2');
echo "ENC1:" . $encrypted_1;
echo "ENC2:" . $encrypted_2;
?>
好吧,这ecnryption在MySQL工作与mysql_real_escape_string()
。 使用sqlite_escape_string()
它报告:致命错误:调用未定义的函数sqlite_escape_string()。 AES PHP加密:对加密我使用这个:http://www.coderelic.com/2011/10/aes-256-encryption-with-php/
我检查的phpinfo()和我已经启用:
- PDO驱动程序:MySQL的
- sqlite的启用
- PDO驱动程序的SQLite 3。 X启用
- SQLite库3.7.7.1启用
- sqlite3的支持sqlite3的模块版本0.7启用
- SQLI TE图书馆3.7.7.1启用
我使用WAMP服务器Apache的版本22年2月22日和PHP版本5.4.3我tryed与Zend Server和定期Apache和PHP安装目录和一个同样的错误。请为此需要帮助。
虽然我同意这个答案,但不推荐使用与已删除的不同。它应该仍然在理论上工作,不是吗? – crush
确定如此insted:$ encrypted_1 = sqlite_escape_string($ AES-> encrypt($ Col1));我必须使用这个:$ encrypted_1 = SQLite3 :: escapeString($ AES-> encrypt($ Col1)); – djpetrovic
是的,我的错误...它被删除。正如您从手册中看到的,它仅在低于5.4的版本上可用。 http://php.net/manual/en/function.sqlite-escape-string.php – lexmihaylov