RE: [PHP] Paging and permissions

2011-02-09 Thread Arno Kuhl
On Tue, 2011-02-08 at 14:36 +0200, Arno Kuhl wrote: I'm hoping some clever php gurus have been here before and are willing to share some ideas. I have a site where articles are assigned to categories in containers. An article can be assigned to only one

RE: [PHP] Paging and permissions

2011-02-09 Thread Ashley Sheridan
On Wed, 2011-02-09 at 13:03 +0200, Arno Kuhl wrote: On Tue, 2011-02-08 at 14:36 +0200, Arno Kuhl wrote: I'm hoping some clever php gurus have been here before and are willing to share some ideas. I have a site where articles are assigned to categories in

RE: [PHP] Paging and permissions

2011-02-09 Thread Arno Kuhl
Instead of serializing the articles, you only need their IDs. Using $sql .= ' where id in (' . implode(',', $ids) . ')'; you can load the data for a page of results in a single query. Storing the IDs is much cheaper than the articles. If the permissions are fairly static (i.e. access for

RE: [PHP] Paging and permissions

2011-02-09 Thread Ashley Sheridan
On Wed, 2011-02-09 at 13:27 +0200, Arno Kuhl wrote: Instead of serializing the articles, you only need their IDs. Using $sql .= ' where id in (' . implode(',', $ids) . ')'; you can load the data for a page of results in a single query. Storing the IDs is much cheaper than the

[PHP] Paging and permissions

2011-02-08 Thread Arno Kuhl
I'm hoping some clever php gurus have been here before and are willing to share some ideas. I have a site where articles are assigned to categories in containers. An article can be assigned to only one category per container, but one or more containers. Access permissions can be set per article,

Re: [PHP] Paging and permissions

2011-02-08 Thread David Hutto
On Tue, Feb 8, 2011 at 7:36 AM, Arno Kuhl ak...@telkomsa.net wrote: I'm hoping some clever php gurus have been here before and are willing to share some ideas. I have a site where articles are assigned to categories in containers. An article can be assigned to only one category per container,

Re: [PHP] Paging and permissions

2011-02-08 Thread Ashley Sheridan
On Tue, 2011-02-08 at 14:36 +0200, Arno Kuhl wrote: I'm hoping some clever php gurus have been here before and are willing to share some ideas. I have a site where articles are assigned to categories in containers. An article can be assigned to only one category per container, but one or

Re: [PHP] Paging and permissions

2011-02-08 Thread Tolas Anon
On Tue, Feb 8, 2011 at 1:36 PM, Arno Kuhl ak...@telkomsa.net wrote: I'm hoping some clever php gurus have been here before and are willing to share some ideas. I have a site where articles are assigned to categories in containers. An article can be assigned to only one category per

Re: [PHP] Paging and permissions

2011-02-08 Thread David Harkness
On Tue, Feb 8, 2011 at 4:36 AM, Arno Kuhl ak...@telkomsa.net wrote: But it might be an option if done once at the start of each search or list request, and then use that temporary modified result set for subsequent requests on the same set. Instead of serializing the articles, you only need