godsent Posted November 29, 2009 Share Posted November 29, 2009 I am trying to make that code would select id value less then current. For example if account have values: 5 7 9 (current) 12 I want this to select value "7". But now it always select the first value "5". I understand why it selects first, but i don't know how to make it select one below. $query = "SELECT * FROM playlist WHERE account = '$user' AND id < '$current' LIMIT 1"; Please help if you know what i mean, sorry for English. Quote Link to comment https://forums.phpfreaks.com/topic/183284-get-1-of-existing-value/ Share on other sites More sharing options...
trq Posted November 29, 2009 Share Posted November 29, 2009 $query = "SELECT * FROM playlist WHERE account = '$user' AND id < '$current' ORDER BY id DESC LIMIT 1"; Quote Link to comment https://forums.phpfreaks.com/topic/183284-get-1-of-existing-value/#findComment-967394 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.