1
QUERY :쿼리를 실행하는 동안 sql 구문 오류가 발생했습니다 (sql injection)?
model.client.query("SELECT (6371 * acos(cos(radians(:latitude)) * cos(radians(latitude)) * cos(radians(longitude) - radians(:longitude)) + sin(radians(:latitude)) * sin(radians(latitude)))) AS distance FROM offers where isActive= :isActive ",{'latitude': latitude, 'longitude': longitude,'isActive':1},function (err,rows) {
console.log(err);
});
오류는
{ 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 ':latitude)) * cos(radians(latitude)) * cos(radians(longitude) - radians(:' at line 1
매개 변수는 쿼리로 대체되지 않아요. – Shadow
나는 그것이 왜 일어나지 않는지 이해했다. –
이것이 새로운 이유가 MySQL 오류의 원인이라면, 왜 우리와 공유하지 않았습니까? 이 경우 정확히 MySQL 오류가 발생하며 일반적으로 MySQL은이 질문과 관련이 있습니까? – Shadow