Title: Insert user_id
Last modified: August 24, 2016

---

# Insert user_id

 *  [cstack](https://wordpress.org/support/users/cstack/)
 * (@cstack)
 * [11 years ago](https://wordpress.org/support/topic/insert-user_id/)
 * I’m trying to INSERT the current_user into a separate db for future querying.
   I want it to insert into the most recent entry – ie. INSERT_LAST_ID().. but it’s
   not working with an INSERT query using WHERE=INSERT_LAST_ID()
    or with an UPDATE
   query using same. I’ve also tried MAX(id) in place of it with no luck. I can,
   however, successfully query SELECT MAX(id) FROM table1.
 * Anyone know why this max id doesn’t want to work?
    Thank you

The topic ‘Insert user_id’ is closed to new replies.

## Tags

 * [id](https://wordpress.org/support/topic-tag/id/)
 * [max](https://wordpress.org/support/topic-tag/max/)
 * [MySQL](https://wordpress.org/support/topic-tag/mysql/)

 * 0 replies
 * 1 participant
 * Last reply from: [cstack](https://wordpress.org/support/users/cstack/)
 * Last activity: [11 years ago](https://wordpress.org/support/topic/insert-user_id/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
