How to prepare an array of values with $wpdb
Not quite there. In your first example you have sku LIKE %s and in your example you have product_sku LIKE ‘%{$matchedProduct->sku}%’. That’s not the same. $wpdb->prepare() uses sprintf replacements. That’s where you get the %s in your first query. If you look at the sprintf documentation under specifiers, you’ll find a list of replacement patterns. … Read more