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 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']; 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 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. Link to comment https://forums.phpfreaks.com/topic/154877-solved-query-help/#findComment-814607 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.