> 1.
> 2.
Both seem fine to me.
> 3. At the time of upload, it is possible to specify a list of
> users who can "view" and "modify" the file. Currently I am storing
> this list as a whitespace-separated list in a mySQL TEXT column.
>
> Column "view" data: 3 11 1
>
> At the time of displaying the list, I first SELECT * the entire list
> of files, and then use explode() in combination with a "for" loop to
> split up the "view" field and match each element againt the current
> user's ID. Only if a match is found will I display the filename.
>
> I suspect this approach is not optimal. Can anyone suggest a
> better approach?
Rather than a whitespace-separated list, store one ID as a "|ID|". So
your field might look like:
Column "view" data: '|3||11||1|'
That way, knowing the user's ID who is viewing docs, you can select
<<blah blah>> WHERE view LIKE '|$thisusersidnumber|' ... no longer
any need to step through and explode the array.
Jason
--
PHP General 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]