$wpdb->prepare with an sql like "WHERE id IN()"
-
If I try to use a prepare with a query like
post_id IN (50, 48, 46, 44, 42)
if I use a placeholder for number %d, it returns only the first one.
If I use the string placeholder, like %s, it doesn’t work also, because the query becomes
post_id IN ('50, 48, 46, 44, 42')
is there a solution for that? or do i have just to validate the IDs by myself and use not the placeholder?
thanks
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘$wpdb->prepare with an sql like "WHERE id IN()"’ is closed to new replies.