Re: Query or Array functions [message #176964 is a reply to message #176962] |
Fri, 10 February 2012 13:43 |
Scott Johnson
Messages: 196 Registered: January 2012
Karma:
|
Senior Member |
|
|
On 2/10/2012 3:06 AM, Thomas 'PointedEars' Lahn wrote:
> 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
Man I never even considered the possible data change in which with using
preloaded arrays the page would have to be reloaded to update the data.
So that alone is a deal breaker for the array method.
Thanks for the different look.
|
|
|