How to find the last line number in the table?
2 answers
It's impossible. The table does not have line numbers to rely on.
- Thanks for choosing SELECT MAX (id) FROM table - cas
- id is not a row number in a table. - uilenspiegel
- And what then - cas
- this is always an increasing number that is part of the data. Not line number. Imagine that you inserted three lines with id 1, 2 and 3. And then the line with id = 2 was deleted. Auto-increment is not a line number. This is just a number that defines a string. There is a row in the table - there is a number, there is no row - there is no number in the table. - uilenspiegel
- And how then to define - cas
|
Maybe this will help you mysql-insert-id property
|