ballouta Posted April 20, 2009 Share Posted April 20, 2009 hello, I have many rows inserted into a table in my DB, the ID is a primary key and it is set to auto increment, I have another column called 'arrange', (int). I want to get the last 'arrange' value inserted in the table (when ID is order by ASC). please help, Thank you Quote Link to comment https://forums.phpfreaks.com/topic/154877-solved-query-help/ Share on other sites More sharing options...
jackpf Posted April 20, 2009 Share Posted April 20, 2009 You mean like this? $sql = mysql_query("SELECT * FROM table ORDER BY id DESC LIMIT 1"); $fetch = mysql_fetch_array($sql); $last_arrange = $fetch['arrange']; Quote Link to comment https://forums.phpfreaks.com/topic/154877-solved-query-help/#findComment-814570 Share on other sites More sharing options...
ballouta Posted April 20, 2009 Author Share Posted April 20, 2009 Thank you Quote Link to comment https://forums.phpfreaks.com/topic/154877-solved-query-help/#findComment-814577 Share on other sites More sharing options...
jackpf Posted April 20, 2009 Share Posted April 20, 2009 Jolly good. Quote Link to comment https://forums.phpfreaks.com/topic/154877-solved-query-help/#findComment-814607 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.