mysqli get last row code example Example: mysqli last row SELECT id FROM table ORDER BY id DESC LIMIT 1;