Anonymous Asked in Cars &Transportation · 2 weeks ago

How do I find the last inserted post ID in WordPress?

14 июн. 2010 г. · Â Here's the thing: the wp_insert_post() function returns the newly inserted post's ID, so you can use it to perform more stuff on the post .


How do I find the last insert id in WordPress?

If you want to get the last inserted row ID from the WordPress database. You can use the $wpdb->insert() it does the insert. $lastid = $wpdb->insert_id; You can find more information about how to do things the WordPress way can be found in the WordPress codex.

How do I get the last inserted row id?

If you are AUTO_INCREMENT with column, then you can use last_insert_id() method. This method gets the ID of the last inserted record in MySQL.

How do I get last inserted data?

you can get the id if you call LAST_INSERT_ID() function immediately after insertion and then you can use it. Show activity on this post. For any last inserted record will be get through mysql_insert_id() If your table contain any AUTO_INCREMENT column it will return that Value.

How can I get last insert id in PDO?

You can get the id of the last transaction by running lastInsertId() method on the connection object($conn).

Related Questions

Relevance
Write us your question, the answer will be received in 24 hours