rockinaway Posted January 4, 2012 Share Posted January 4, 2012 I have a MYSQL Limit statement that simply uses 'LIMIT 10' at the end. This gets the latest information using a 'WHERE time < '.$current_time.'' However, if there aren't another 10 rows to return from the database, it fails to return any rows. How can I limit it to a max of 10 rows but still to return rows if there are less than 10? Quote Link to comment https://forums.phpfreaks.com/topic/254327-limit/ Share on other sites More sharing options...
Muddy_Funster Posted January 4, 2012 Share Posted January 4, 2012 could you post you code please? Limit should not behave the way you are describing. Quote Link to comment https://forums.phpfreaks.com/topic/254327-limit/#findComment-1304088 Share on other sites More sharing options...
rockinaway Posted January 4, 2012 Author Share Posted January 4, 2012 I just did some troubleshooting and it seems to be another issue. What does this error mean? mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 12 Quote Link to comment https://forums.phpfreaks.com/topic/254327-limit/#findComment-1304090 Share on other sites More sharing options...
rockinaway Posted January 4, 2012 Author Share Posted January 4, 2012 Solved it. Seemed my id's in the db were getting mixed up and so the results weren't returning as expected Quote Link to comment https://forums.phpfreaks.com/topic/254327-limit/#findComment-1304093 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.