adzie Posted April 18, 2008 Share Posted April 18, 2008 Hello folks, I want to display the next available row in my DB, I can get it to display the last row but want it to show that +1 ie the next available row. Any thoughts $qry = "SELECT * FROM user ORDER BY user_id DESC LIMIT 1"; $res = mysql_query($qry); $row = mysql_fetch_array($res); Link to comment https://forums.phpfreaks.com/topic/101727-result-1/ Share on other sites More sharing options...
haku Posted April 18, 2008 Share Posted April 18, 2008 $qry = "SELECT * FROM user ORDER BY user_id DESC LIMIT 2, 1"; The limit says "start at the second entry, and get 1 entry. Link to comment https://forums.phpfreaks.com/topic/101727-result-1/#findComment-520462 Share on other sites More sharing options...
Zhadus Posted April 18, 2008 Share Posted April 18, 2008 $qry = "SELECT * FROM user ORDER BY user_id DESC"; $res = mysql_query($qry); while ($row = mysql_fetch_array($res)) { echo $row; $values[] = $row; } You could load all the values up and display exactly what you need. Link to comment https://forums.phpfreaks.com/topic/101727-result-1/#findComment-520464 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.