last_insert_id() is used right after you inserted a new row and you need to grab the id of that row to perform some other task.
If you need to get the last row that was inserted in the db you can used ORDER BY id DESC this will give you the last row of the table (given that id is an auto-increment field)