Link to home
Start Free TrialLog in
Avatar of GodDoesntExist
GodDoesntExist

asked on

Get current id from MySQL post/query?

Hi Experts!

In the same PHP file I want to:

1. I want to create a new user and post it to the database (that code is already created)

2. echo the user id for that new user.

How can I do that?

I could find out the highest user id from the database and echo that, but it doesnt feel 100% safe.

Is there a way to find out the "current" id that was posted at that moment?

Thanks in advice!
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of GodDoesntExist
GodDoesntExist

ASKER

Thank you!

Perfect solution!