I do the initial search, and store the results in a server-side
$firstRecord = "($pageNumber - 1) * $g_NumToDisplayPerPage"
$lastRecord = "$firstRecord + $g_NumToDisplayPerPage"
Make sure you don't get a HUGE result set. Session cookies work
well if they're relatively small. You're trading off multiple-searches
(1 per page) vs storing the results which is faster. Some people
are against cookies, 'cause you can't guarantee that they're turned on.
array, but then you assume that the client has a large buffer available
on his/her machine. Pick your poison.
Anything you do will have tradeoffs, I made this one - limit the search
results and use the session cookies. If that gets too intensive, I can
break out the session stuff to it's own box - session cookies don't
transfer the whole thing on each page load, but it DOES load the
whole thing (since it's server-side) on each page load. Make sure
you put a "clean-up" once they leave your search-results page, or
you'll have dozens of users all with search results after they're already
done searching and each one wasting cycles loading/reloading it. =)
Global includes work well for this -
Anyone got any improvements on this?
Peace, love, code.
----- Original Message -----
From: "Mark @ 10base-t.com" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, May 14, 2001 1:02 PM
Subject: [PHP-DB] Url link
> Hey there,
> I'm trying to build NEXT/PREV buttons on my search page.
> The only way I know to do it so far is via an url.
> So the link I create is the following:
> I'm passing the where= portion as a variable to my query string.
> $query = "select blah from employee where $where order by blah limit blah"
> But it makes the where section into this:
> select id, lname, fname, extension, locid, email from employee where
> historical_yn=\'N\' and fname like \'%%\' and lname like \'%%\' and dept
> like \'%10%\' and locid like \'%%\' order by lname limit 1,20
> The problem is it's putting \'s in the where variable and it makes the
> Does anyone know how best to get rid of the \'s or a better way to do
> next/prev buttons?
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]