How to use prepared statements in queries with an IN clause in PHP [duplicate]
问题 This question already has an answer here : Bind multiple parameters into mysqli query (1 answer) Closed 2 years ago . I need to make a simple query $array_of_ids = array(); //poulate $array_of_ids, they don't come from another db but from Facebook //so i can't use a subquery for the IN clause $wpdb->prepare("SELECT id from table where id IN (%d, %d)", $array_of_ids [0], $array_of_ids [1]); The question is, if i have 200 elements in the array, what is the correct way to handle this?Do i have