I am inserting the values into the database but i need the password to be encrypted and then insert the special characters to it. I am using mysql database and coding is done in normal php program.
PHP PROGRAM
$mysecretkey = 'd5k8b6q3';
$password=(AES_ENCRYPT('$v4','$mysecretkey')); // problem is here in encryption
$q="insert into customers (name,username,email,password) values('$v1','$v2','$v3','$password')";
$s= mysql_query($q);
if(!$s)
{
$r["re"]="Inserting problem in database";
print(json_encode($r));
}
else
{
$r["re"]="Record inserted successfully";
}
But when i execute the code instead of encrypting it i am getting error
Fatal error: Call to undefined function AES_ENCRYPT() in ..../checking.php on line 5
how to solve this problem and other details is the password field in the database is varchar and i am fetching the data from POST variable v1,v2,v3,v4 and test key is added in the above code.
when i give the password as "test123"
after AES encryption the data has to insert is this "÷A5jèŸ2A1::h "
Thanks for your help and time friends........ Please tell how to solve this issue