View Single Post

  #7 (permalink)  
Old 03-09-2008
Michael Fesser
 
Posts: n/a
Default Re: Arrays as Session Variables?

..oO(Tim Roberts)

>Alan M Dunsmuir <alan@moonrake.demon.co.uk> wrote:
>>
>>To avoid repeated hits on my database, I'd like to use a single access,
>>from which I can create a list of all the records of a particular type
>>which already exist.
>>
>>I'd then have to store the identifiers of all these existing records as
>>the members of an associative array, but I'd have to be able to copy
>>this array's members to a Session Variable.

>
>...which is then stored in a flat file on your server's hard disk (by
>default), and which gets re-read and re-parsed for every PHP request. Are
>you sure that's an improvement?


Impossible to say without more details. In some cases caching the result
can be an improvement, for example if the query is complex or the DB is
not MySQL where connections are cheap.

Micha
Reply With Quote