Re: Photo Album Schema

From: Date: Tue, 21 Aug 2001 18:39:44 +0000
Subject: Re: Photo Album Schema
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-11622@lists.php.net to get a copy of this message
That is a good point. I see two obvious answers. Instead of "id" . "filename" he could use "id" . "+" . "filename" (or any non alphanumeric character instead of +) first running the filename through an ereg to strip any non-alphanumeric characters. The other is to require that the first character in the filename be alpha... which is also easily enforcable with a simple ereg. Sheridan Saint-Michel Website Administrator FoxJet, an ITW Company www.foxjet.com ----- Original Message ----- From: "Justin Buist" <jbuist@tridenttechnology.com> To: <php-db@lists.php.net> Sent: Tuesday, August 21, 2001 11:50 AM Subject: Re: [PHP-DB] Photo Album Schema > I'm going to play Devil's advocate a little bit more here. > > Lets say user #1 uploads 1family.jpg, and user 11 uploads family.jpg. > > "1" . "1family.jpg" == "11family.jpg" > "11" . "family.jpg" == "11family.jpg" > > You run into stuff like this anytime you let users upload files of any > sort. > > Justin Buist > Trident Technology, Inc. > 4700 60th St. SW, Suite 102 > Grand Rapids, MI 49512 > Ph. 616.554.2700 > Fx. 616.554.3331 > Mo. 616.291.2612 > > On Tue, 21 Aug 2001, Sheridan Saint-Michel wrote: > > > If you are going to use a single directory with a filename > > convention I would suggest something simple, yet unique > > like > > > > "id" . "filename" > > > > Where id is the unique userid from the DB and filename > > is the original name of the file. > > > > This would avoid conflicts (which is the point of a naming convention) > > and be fairly easy to implement. > > > > Sheridan Saint-Michel > > Website Administrator > > FoxJet, an ITW Company > > www.foxjet.com > > > > > > ----- Original Message ----- > > From: "Anthony Carlos" <anthony@digitalphenom.com> > > To: "Rick Emery" <remery@excel.com>; "PHP-DB" > > <php-db@lists.php.net> > > Sent: Tuesday, August 21, 2001 11:47 AM > > Subject: RE: [PHP-DB] Photo Album Schema > > > > > > > I vote for one directory to simplify the programming side of things. What > > do > > > you guys recommend for the filename convention? > > > > > > Would you let users determine it or would you force them into something > > like > > > a primary key? > > > > > > Anthony Carlos > > > > > > -----Original Message----- > > > From: Rick Emery [mailto:remery@excel.com] > > > Sent: Tuesday, August 21, 2001 11:55 AM > > > To: PHP-DB > > > Subject: RE: [PHP-DB] Photo Album Schema > > > > > > > > > I vote for a single directory. Then use Sheridan's naming suggestion. > > > > > > Richard Emery > > > Excel Communications, Inc. > > > IT Sr. Project Manager > > > (972) 478-3398 > > > (972) 944-0542 (pager) > > > > > > There is no "trying"... > > > There is only "Do" or "Not Do" > > > > > > > > > > > > -----Original Message----- > > > From: Jeff Oien [mailto:jeff@webdesigns1.com] > > > Sent: Tuesday, August 21, 2001 10:49 AM > > > To: PHP-DB > > > Subject: RE: [PHP-DB] Photo Album Schema > > > > > > > > > I should have said photo_filename. That was what I intended to do. > > > Would you suggest one directory for all photos or separate directories > > > for each user? > > > Jeff Oien > > > > > > > Rick: I don't see any .php tags there... plus just because someone > > > > else has done it doesn't mean he can't do it as well =) > > > > > > > > Jeff: The only critique I would give from the description you have > > > > given us thus far is the fact that you appear to be storing the photo > > > > in the DB. > > > > > > > > The biggest bottleneck in a server-side script is usually the DB calls. > > > > With this in mind, you want to limit these calls as much as possible. > > > > > > > > I would suggest setting up a naming and/or directory scheme to store > > > > the pictures on the website, and then store the URL of the picture in > > the > > > > DB, rather than the image itself. > > > > > > > > Then when outputing the page just do something like > > > > > > > > echo "<Img > > > > src=\"$queryresult['location']\">"; > > > > > > > > Sheridan Saint-Michel > > > > Website Administrator > > > > FoxJet, an ITW Company > > > > www.foxjet.com > > > > > > > > ----- Original Message ----- > > > > From: "Rick Emery" <remery@excel.com> > > > > To: <jeff@webdesigns1.com>; "PHP-DB" > > > > <php-db@lists.php.net> > > > > Sent: Tuesday, August 21, 2001 10:19 AM > > > > Subject: RE: [PHP-DB] Photo Album Schema > > > > > > > > > > > > > This has been done. see > > > > > http://www.photopoint.com > > > > > > > > > > This is a free service available to the public. > > > > > > > > > > rick > > > > > > > > > > Richard Emery > > > > > Excel Communications, Inc. > > > > > IT Sr. Project Manager > > > > > (972) 478-3398 > > > > > (972) 944-0542 (pager) > > > > > > > > > > There is no "trying"... > > > > > There is only "Do" or "Not Do" > > > > > > > > > > > > > > > > > > > > -----Original Message----- > > > > > From: Jeff Oien [mailto:jeff@webdesigns1.com] > > > > > Sent: Tuesday, August 21, 2001 10:12 AM > > > > > To: PHP-DB > > > > > Subject: [PHP-DB] Photo Album Schema > > > > > > > > > > > > > > > I want to make a photo album that will have users who sign up > > > > > to create an album and then have the albums open to the public. > > > > > I was thinking of doing it like this but I've never done a relational > > > > > database before so if anyone thinks of anything I should change > > > > > please let me know. Thanks. > > > > > Jeff Oien > > > > > > > > > > Table1: > > > > > -username > > > > > -password > > > > > -album_title > > > > > -creation_date > > > > > -id > > > > > > > > > > Table2: > > > > > -id (from Table1) > > > > > -photo (jpg or gif) > > > > > -date > > > > > -photo_title > > > > > -description (limited length) > > > > > > > > > > > > > > > > -- > > > > PHP Database Mailing List (http://www.php.net/) > > > > To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net > > > > For additional commands, e-mail: php-db-help@lists.php.net > > > > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > > > > > > > > > -- > > > PHP Database Mailing List (http://www.php.net/) > > > To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net > > > For additional commands, e-mail: php-db-help@lists.php.net > > > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > > > > > -- > > > PHP Database Mailing List (http://www.php.net/) > > > To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net > > > For additional commands, e-mail: php-db-help@lists.php.net > > > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > > > > > > > > -- > > > PHP Database Mailing List (http://www.php.net/) > > > To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net > > > For additional commands, e-mail: php-db-help@lists.php.net > > > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > > > > > -- > > PHP Database Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net > > For additional commands, e-mail: php-db-help@lists.php.net > > To contact the list administrators, e-mail: php-list-admin@lists.php.net > > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net > For additional commands, e-mail: php-db-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.db (#11622) next »