Make a SQL query with wpdb in WordPress
The main problem is how you’re specifying the custom table name (e.g., $wpdb->cf7dbplugin_submits). $wpdb only knows about the “built-in” tables when accessing a table name via $wpdb->xxx. To specify access a custom table name, use {$wpdb->prefix}custom_table_name. The other thing I notice is that, for security purposes, you should never use interpolated variables in an SQL … Read more