Re: Query or Array functions [message #176962 is a reply to message #176956] |
Fri, 10 February 2012 11:06 |
Thomas 'PointedEars'
Messages: 701 Registered: October 2010
Karma:
|
Senior Member |
|
|
Scott Johnson wrote:
> The problem I see is the numerous DB queries and I don't see querying
> the DB each time the user types a letter as a practical approach. (I
> could be wrong).
You do not have a PHP problem unless you are using PHP client-side. Start a
client-side timer that must reach zero before the request is made that
invokes the database query server-side. Reset it when the user types a
second character into the form control. It has been done before.
> What I was thinking of doing is loading the full record set into an
> array and then filter out the array of the needed data as the user types.
That might be feasible if the original data was not modified after retrieval
and it was not too large for the client system to process. In all other
cases you want to do the filtering server-side.
> I have not done any intense array manipulations like this before and am
> wondering if this seems like a practical approach.
You would not be manipulating *PHP* arrays (but see above), so …
PointedEars
--
When all you know is jQuery, every problem looks $(olvable).
|
|
|