-2

I have a table like this

id     path
1      image-1.jpg
2      image-2.jpg
5      image-5.jpg
9      image-9.jpg

I have deleted many last inserted row, I want to know the next increase id exactly will be inserted to set the path right like above!

1 Answers1

0

You should achieve this in 2 steps.

  • insert a record with path = '' and increment ID will be inserted
  • in second step, get last inserted ID and then make path and update to that id.
Naveed Ramzan
  • 3,565
  • 3
  • 25
  • 30