0

I need to test mysql queries in Mysql client. Therefore i need to define array in mysql, but i can't find how? Could you help me please? I define array from backend:

WHERE
  rates.id IN  (:array) //node or rates.id IN ($array) php 
axon
  • 109
  • 2
  • 11
  • Is your actual question ["how to bind an array in a mysql query in php"](http://stackoverflow.com/questions/920353/can-i-bind-an-array-to-an-in-condition)? – h2ooooooo Apr 20 '16 at 17:05

1 Answers1

0

I'm not aware of any language/library supporting parameterized queries that supports collections of any sort as parameters. If you can find no other way to do it, using FIND_IN_SET should allow similar behavior (though you'll have to turn your array into a single string parameter; and it is a string function, and function in general, so it will make the query slow.

Performance-wise you are better off just manually constructing your query with the list in it; but then you lose the benefits/security of parameterization.

Uueerdo
  • 15,723
  • 1
  • 16
  • 21