07-10-2004, 07:45 PM
i have a database at http://www.startbar.co.uk/coursemanager/courses.asp
it shows a list of course entries.
how can i create a seperate section to go on another page with the 'next five courses' so it will only show the next 5 entries?
like a 'headlines' system on a news script.
run a google or a search here or at www.hotscripts.com for 'recordset paging' or 'pagination'. Plenty of tutorials and examplecode for whatever db-format you are using, will popup
07-12-2004, 08:20 PM
actaully i meant like just showing the first five entries of a database.
list of ten
1 to 10
and ONLY showing 1, 2, 3, 4, 5
and thats it. the first five!
i don't realy understand it and you probably didn't look up recordset paging, because with recordsetpaging, you do exactly the same. Only the ofset will be different. If you just need t first 5, then all you need is
(for Jet DB's --> access or ms server)
select top 5 your variables from table order by tablesautonumcolumn asc
select your variables from table order by tablesautonumcolumn asc
tablesautonumcolumn should be replaced by whatever columns you want to sort on.
Note: TOP does not discriminate ! So if your values (from tablesautonumcolumn) are 1,2,3,4,5,5,5,5,5,5,,5,5,5,5,5,5,5,5,5,5,5,6,6,6,7,7,7
then TOP 5 would include 1,2,3,4,5,5,5,5,5,5,,5,5,5,5,5,5,5,5,5,5,5
LIMIT 5 would just return 1,2,3,4,5
Powered by vBulletin® Version 4.2.2 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.