$wpdb->insert_id

There is no other way, but I can not see how you need any other way then this. I believe that the insert ID accessed by $wpdb is the last ID by this instance of WPDB, other inserts should not affect that but I’m not sure.

<?php

  $wpdb->insert("QUERY");

  $this_insert = $wpdb->insert_id;

?>

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)