FinalFrontier Posted January 21, 2012 Share Posted January 21, 2012 I have a row in a MySQL table called id, which auto-increments. I was wondering if anyone knows a PHP solution to find out what the highest number in the row is? I am thinking perhaps execute a MySQL query that will list the highest number, and then echo the result, like $row[id] in PHP? Quote Link to comment https://forums.phpfreaks.com/topic/255466-finding-out-the-highest-number-in-an-auto-incrementing-table/ Share on other sites More sharing options...
SergeiSS Posted January 21, 2012 Share Posted January 21, 2012 Do you ever heard about function MAX() in MySQL? You need it. Quote Link to comment https://forums.phpfreaks.com/topic/255466-finding-out-the-highest-number-in-an-auto-incrementing-table/#findComment-1309788 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.