我正在尝试进行基本的mysql更新,但使用AES_ENCRYPT - 任何人都可以解释为什么我收到错误消息?以下是查询: -
UPDATE MailList
SET Email = AES_ENCRYPT( arandomemail@hotmail.com, 'jkfdsfsaKJjdsf' )
WHERE ID = '138142'
我收到以下错误:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@hotmail.co.uk,'jkaKJjkH87') WHERE MailListID = '138142'' at line 1
答案 0 :(得分:6)
UPDATE MailList
SET Email = AES_ENCRYPT( 'arandomemail@hotmail.com', 'jkfdsfsaKJjdsf' )
WHERE ID = '138142'
答案 1 :(得分:4)
您忘记了要加密的邮件周围的'
。
UPDATE MailList
SET Email = AES_ENCRYPT( 'arandomemail@hotmail.com', 'jkfdsfsaKJjdsf' )
WHERE ID = 138142
答案 2 :(得分:2)
您需要将电子邮件地址arandomemail@hotmail.com
放在引号中。
UPDATE MailList
SET Email = AES_ENCRYPT( 'arandomemail@hotmail.com', 'jkfdsfsaKJjdsf' )
WHERE ID = '138142'