[thelist] sql query php layout

rudy r937 at interlog.com
Sun Nov 24 14:31:02 CST 2002


> it's the rolling effect that is really producing high levels of
> head scratching

they have a cream for that

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

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