Title: mysql_insert_id() and WP
Last modified: August 19, 2016

---

# mysql_insert_id() and WP

 *  Resolved [husar](https://wordpress.org/support/users/husar/)
 * (@husar)
 * [18 years, 1 month ago](https://wordpress.org/support/topic/mysql_insert_id-and-wp/)
 * I am creating a plugin and for the first time I am creating tables and inserting
   data. I have all that work but now I want to validate the insert was successful.
 * Can I use mysql_insert_id() or is there something equivalent I need? I tried 
   mysql_insert_id() last night without much luck. I would like to avoid just doing
   another select statement if possible. But that is always an option I guess.
 * Cheers

Viewing 1 replies (of 1 total)

 *  Thread Starter [husar](https://wordpress.org/support/users/husar/)
 * (@husar)
 * [18 years, 1 month ago](https://wordpress.org/support/topic/mysql_insert_id-and-wp/#post-737046)
 * Well, I guess if I was using an auto increment field it might work.
 * My bad.

Viewing 1 replies (of 1 total)

The topic ‘mysql_insert_id() and WP’ is closed to new replies.

 * 1 reply
 * 1 participant
 * Last reply from: [husar](https://wordpress.org/support/users/husar/)
 * Last activity: [18 years, 1 month ago](https://wordpress.org/support/topic/mysql_insert_id-and-wp/#post-737046)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
