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.

how i show manual data in a post

You can perform cusom SQL queries on the WordPress database using WPDB. For example: $row = $wpdb->get_row(“SELECT * FROM $wpdb->test WHERE id = 123”); You can then access your id, name and description fields like so: echo $row[‘id’]; echo $row[‘name’]; echo $row[‘description’];

Separate by Category Post Type

To get custom post type posts with specific category use custom taxonomy Register the taxonomy name of the custom post type like location and then assign location to each post when you added new post. Here is the example of the code add_action( ‘init’, ‘hotels_my_taxonomy’); function hotels_my_taxonomy(){ // custom post type taxonomies $labels = array( … Read more

Update database record in plugin

It’s really hard to understand what are you actually doing ( a refactor will help also). but for updating you can try: You will need the $id, show you tell which row to update. $wpdb->update( $wpdb->prefix . ‘tropix_dmin’, array( ‘post_name1’ => $arr), array( ‘id’ => $id ), array( ‘%s’ ), array( ‘%d’ ) );