javascript array as a list of strings (preserving quotes)

前端 未结 5 797
刺人心
刺人心 2021-01-31 16:05

I\'ve got an array of strings. When I use .toString() to output it the quotes are not preserved. This makes it hard to build the mysql query using an \"in\". Consider the fol

5条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-31 17:02

    The simple fix is adding the quotes yourself

    for(var i=0; i

    Do note that I completely ignore SQL injection issues here.

提交回复
热议问题