在php中解密电子邮件id,并通过匹配电子邮件id更新数据库表
我想用php解密我的电子邮件id,我带来了来自json的加密电子邮件id。我必须通过在数据库中匹配此解密的电子邮件id来更新数据库表。但我无法从解密的电子邮件id更新它。解密后,我获得了正确的电子邮件id。但无法更新数据库表在php中解密电子邮件id,并通过匹配电子邮件id更新数据库表,php,mysql,Php,Mysql,我想用php解密我的电子邮件id,我带来了来自json的加密电子邮件id。我必须通过在数据库中匹配此解密的电子邮件id来更新数据库表。但我无法从解密的电子邮件id更新它。解密后,我获得了正确的电子邮件id。但无法更新数据库表 `code here` $decryptEmail=null; $email = $this->_request['a']; $password = $this->_request['b'];
`code here`
$decryptEmail=null;
$email = $this->_request['a'];
$password = $this->_request['b'];
if($email!="")
{
$mcrypt = new MCrypt();
$decrypted = $mcrypt->decrypt($email);
$decryptEmail = utf8_decode(urldecode($decrypted));
}
if($decryptEmail=="")
{
echo 'empty';
}
else
{
echo $decryptEmail;
$result = mysql_query("UPDATE usertable SET LoginStatus='t where substr (EmailID,1,length(trim(EmailID)))=substr('$decryptEmail',1,length(trim('$decryptEmail')))") or die('Errant query:'. mysql_error());
if (!$result)
{
die('Invalid query: ' . mysql_error());
}
else
{
echo 'Verified successfully.';
}
MYSQL_CLOSE();
旁注:停止使用不推荐的mysql_*函数。用或代替。好的,你想要什么特殊的镶嵌物吗?我得到的错误是什么?您的查询是whack,whats LoginStatus='t where?登录状态只是我必须更新的表的字段。传递解密的电子邮件idM未收到任何错误其jst表明m无法更新数据库表。因为解密的电子邮件id与原始id不匹配