Skip to main content
Tutorial Free

MySQL Auto-Increment: What Happens If Insert Fails?

January 23, 2019
1 min read

Pretty random question, almost like a trivia/pubquiz thing. Let's say I'm doing insert SQL query, and if it fails - for example, some foreign or unique key is violated. What would be the ID of the next successful inserted record? Will it increase?

Let's find out in this short video experiment.

For more videos like this (though this one is pretty untypical for me), subscribe to our YouTube channel!

Enjoyed This Tutorial?

Get access to all premium tutorials, video and text courses, and exclusive Laravel resources. Join our community of 10,000+ developers.

Comments & Discussion

No comments yet…

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.