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.

Recent Courses on Laravel Daily

[NEW] Practical Laravel Security: Packages, Secrets, Supply-Chain Attacks

7 lessons
43 min read

Testing in Laravel 13 For Beginners

26 lessons
1 h 41 min read

Queues in Laravel 13

18 lessons
1 h 12 min read

No comments yet…