我正在使用nodejs中的mariasql模块来连接mariadb。我的问题是:
select * from products where id=1 order by timestamp DESC LIMIT 0,10当我传递要限制的固定值时,此查询工作良好。
现在我尝试从参数中获取值。
select * from products where id=:pid order by timestamp DESC LIMIT :start,:end此查询将引发以下错误。
{ 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 ''0','10'' at line 1 code: 1064 }当它接受where子句的参数值时。
https://stackoverflow.com/questions/48782868
复制相似问题