Home Showing Notice: Undefined property: wpdb::$insertid in D:\wamp\www\wordpress-4.7.1\wordpress\wp-includes\wp-db.php on line 684
Reply: 0

Showing Notice: Undefined property: wpdb::$insertid in D:\wamp\www\wordpress-4.7.1\wordpress\wp-includes\wp-db.php on line 684

user1296
1#
user1296 Published in July 19, 2018, 9:42 am

This question already has an answer here:

  • How to get last inserted row ID from wordpress database? 4 answers

I want to get last inserted id to update table based on this id. For that I used $wpdb->insert_id for getting the last inserted id. But get this issue Notice: Undefined property: wpdb::$insertid in D:\wamp\www\wordpress-4.7.1\wordpress\wp-includes\wp-db.php on line 684

this is my code. Someone please help

$parent_id=$template_load_data['id'];
         $wpdb->insert( 'wp_rxl_templates', array(
                'template_name' => $_POST['template_name_custom'],
                'template_content' => $post_content,
                'created_date' => current_time( 'mysql' ),
                'status' => 'active',
                'default_template'=>'false',
                'parent_template_id'=>''.$parent_id.'',
            ));
            $result_id = $wpdb->insertid;
 $result_data = "select wp_rxl where status ='active' NOT (id = '$result_id')";
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.532247 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO