mysql - How to do a WHERE ... IN in Python safely? -


this question has answer here:

i have list of integer id's correspond rows in database, , need out specific rows specific set of id's. query follows:

select id, name locations id in (1,4,5,7,8,...) 

i imploding list comma separated string, not safe sql injection. there way, using prepared statements, bind list of integers?

if not, suitable workaround check each item in list numeric, , proceeding query?

as far know there s no way in mysql this. implode list of '?' length of locations list, , bind parameters normal prepared statement.


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -