我尝试在Express后端中解析URL,但当我转到类似以下的URL时u9UbWQ==&email=test@test.com,出现错误:ER_解析_错误。Error: ER_PARSE_ERROR: 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 '(email,token) VALUES ('test@test.com', 'Wp JCrZGAHEbDgyC4BExpWkX' at line 1
我的代码:
router.get('/reset-password', function(req, res, next) {
const token = req.query.token;
const email = req.query.email;
connection.query('SELECT * FROM resettoken(email,token) VALUES (?, ?)', [email, token], function(err, result) {
if (err) throw err;
我哪里出错了?为什么请求查询令牌只接受部分令牌“Wp JCrZGAHEbDgyC 4 BExpWkX”,而不是“Wp+ JCrZGAHEbDgyC 4 BExpWkX 17 Y 0 eurUZMu 0 zmu 7 J/5S 3ChuRXoi 3qdBFtdt 6 UlOJvMlsR 4dOlMwlUS/u9 UbWQ ==”
1条答案
按热度按时间vhmi4jdf1#
连接出现问题。查询,正确的是: