[thelist] sql query php layout

Andrew Maynes andrew at humanbehaviour.co.uk
Mon Nov 25 15:20:01 CST 2002


I am not sure I followed this exactly!  I am getting the results displayed like
this
http://www.hificollective.co.uk/books/book_listing.php

and success at getting them displayed like this
http://www.hificollective.co.uk/



appears to be fuitless.  If there is an online article for this that would be
great

>>how do you decide how to lay out the 2 x 3?

displying 1-6 of 9
record1 record2 record3
record4 record5 record6
			>> next results >>



there are many ways to do result set paging

let's say your results were in sequence by one column, alphabetically, and
you have more than six, like A, B, D, F, G, K, M, ...

save the highest (6th) value, and use it to format the "next six" link,
perhaps something like <a href="display.php?startafter=K">

one of the reasons i prefer an actual value rather than a row count is what
happens if there's a new row inserted in between the time the first six are
shown, and the time the user clicks the "next six" link

just consider the ramifications if the new insert is below K, versus if it's
after K

now consider the ramifications if it's below K or after K, and you're
returning rows not by value but by row number (an awfully tempting thing to
do when you have mysql's LIMIT option)

see the difference?


rudy

-




More information about the thelist mailing list