Я пытаюсь выбрать строку в mysql, где моя переменная req.body.email находится в столбце Email_Address это мой фрагмент кода
app.post ('/ login', function (req, res) {
con.query("select * from people where Email_address= "+ req.body.email, (err, res) => {
if (err) {
console.info('the email '+ req.body.email +'does not exist in the database');
throw err;
}
else{
console.info('selected');
if (password == req.body.password)
//res.redirect('index', { title: 'Hey', message: 'Hello there!' });
res.send('hello');
}
});
но я получаю сообщение об ошибке ниже
Ошибка:ER_PARSE_ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '@gmail.com' at line 1
Любые идеи о том, как это решить



![Безумие обратных вызовов в javascript [JS]](https://i.imgur.com/WsjO6zJb.png)


Вам нужно добавить ' в параметр электронной почты, изменить
con.query("select * from people where Email_address= "+ req.body.email
к
con.query("select * from people where Email_address= '"+ req.body.email +"'"
нашел, добавив: var queryy = "select * from people where Email_address =?"; con.query (queryy, [req.body.email], (err, res) => {...}