If you want to select the last row of a table in PHP, follow this example code.
<?php include 'dbconnect.php'; // connect your database page $select_query = mysqli_query($con,"SELECT user_id FROM my_table_name ORDER BY id DESC LIMIT 1"); $row = mysqli_fetch_assoc($select_query); echo $row['user_id']; ?>
I hope it will be helpful for you. thanks for ask here.
Question and answer is powered by AnsPress.io