How to get specific table by current user login

Note that you may need to use WPDB::prepare() to prevent against SQL injections. Although, it might be arguable in your specific case… // If the query does not work, ensure the table name is correct… $table = $wpdb->prefix . ‘SaveContactForm7_1’; $reservations = $wpdb->get_results( $wpdb->prepare( “SELECT * FROM $table WHERE user = %s”, $username ) ); … Read more

Performance bug – slow DB query

It is relatively rare for WP to have query performance issues on a small to moderately sized site: The queries it typically runs are reasonable (not perfect, but reasonable). A lot of things queried are aggressively cached within page load, and persistently with object cache available. While you certainly can throw enough code at it … Read more

How to save dropdown slection by a user in the DB

You can update user meta either through custom code or using a plugin. Advanced custom fields will solve your issue. Check out the reference links for more info : https://support.advancedcustomfields.com/forums/topic/how-to-use-acf-to-add-user-profile-meta/ https://www.advancedcustomfields.com/resources/how-to-get-values-from-a-user/

How can I get $wpdb to show MySQL warnings?

From quick look through the source it doesn’t seem like wpdb actively implements any handling for warnings (as opposed to errors). Proactively you can just ask for them as a custom query ($wpdb->get_results( ‘SHOW WARNINGS;’ ) I suppose, but implicitly they just aren’t tracked by WP core.