Is it good practice to use wpdb->query() function?
If you look a bit into the source, you’ll see that $wpdb->insert() will use ->query() under the hood. So should be the same, right? Not that simple. It doesn’t just use ->query() but also ->prepare(), which is considered best practice. Meanwhile with your code example you’ve probably just opened yourself to SQL injections. The takeaway … Read more