To do any kind of sorting (first, last, etc) you need to have some sort of key with which to sort by, like an ID or an upload date. You have "
video_ID", which hopefully is an auto-incrementing number. If that's the case, then you can use SQL something like this:
SELECT * FROM video ORDER BY video_ID DESC LIMIT 1
This selects 1 row, ordered by the
video_ID in descending order. The result is that you should get the highest (most recent) video_ID.
Also, unless you're selecting out more than 1 row, you don't need to use a WHILE loop. You can just do something like this: