1bigbear Posted November 9, 2009 Share Posted November 9, 2009 I am trying to get 10 entries from a database, but how to do this, the entries have an id number if I take them according with the id number some problems will appear when I delete some of the entries. What to do? Link to comment https://forums.phpfreaks.com/topic/180898-how-to-get-10-entries-from-a-database/ Share on other sites More sharing options...
Mchl Posted November 9, 2009 Share Posted November 9, 2009 SELECT * FROM table WHERE ... LIMIT 10 Link to comment https://forums.phpfreaks.com/topic/180898-how-to-get-10-entries-from-a-database/#findComment-954336 Share on other sites More sharing options...
1bigbear Posted November 9, 2009 Author Share Posted November 9, 2009 I found this $sql="SELECT * FROM data order by id desc limit 10"; but what to use so that query gets only the id that is lower that 1000? Link to comment https://forums.phpfreaks.com/topic/180898-how-to-get-10-entries-from-a-database/#findComment-954406 Share on other sites More sharing options...
gizmola Posted November 9, 2009 Share Posted November 9, 2009 I'd highly recommend a decent tutorial on SQL. $sql="SELECT * FROM data WHERE id Link to comment https://forums.phpfreaks.com/topic/180898-how-to-get-10-entries-from-a-database/#findComment-954408 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.