NYCPHP Meetup

NYPHP.org

[nycphp-talk] photo album

Bradley Baumann bradley at bestweb.net
Mon Dec 23 15:57:03 EST 2002


I've made quite a few of these... you've got a number of options:
I find this to be the best:
Using a simple HTML form, upload the file -- and add the filename / filetype
into a database. NOT THE FILE _ITSELF_. Just the info... also, in the table,
have an ID (auto incr.) field, so that each file / photo is assigned an
individual, exclusive, ID number... then, upload the file, or move it,
rather... with the "move_uploaded_file()" or "copy()" function.
see:
http://www.php.net/manual/en/features.file-upload.php
Name the file itself, with the ID given to the record in the database,
"mysql_insert_id()".
Now, every time you do an SQL search, you can have the "real" name of the
file, it's type, and the ID of the filename handy.... this way you don't
need to worry about files with the same filename, or anything like that...

It really depends on what you want, but this way (with some other features,
too) seems to be good, tried and true.

I hope this method makes some sort of sense. If it doesn't, let me know.
I'll re-explain.

Good luck,
-Bradley.


----- Original Message -----
From: "Michael J Lee" <mike at hilliardfarber.com>
To: "NYPHP Talk" <talk at nyphp.org>
Sent: Monday, December 23, 2002 3:39 PM
Subject: [nycphp-talk] photo album


> Hey All,
> I've got a mySQL/php question here . .
>
> I want to create a photo album using a php script that will call a sql
query
> to help populate the page now the first question is:
>
> What would be the best way to store the images in the database?  Links to
> the images?  Can you store the actual images? (I'm guessing that would not
> be recommended . . )
>
> I figure I would run a for loop that runs the total number of items
returned
> and echo the path into the img tag.
> ie: <img src=<?php echo 'results of query function' ?> border=0> or
> something to this effect.
>
> Anyone do anything like this?  Suggestions?
>
> Thanks!
>
> Mike Lee
>
> -----Original Message-----
> From: Bradley Baumann [mailto:bradley at bestweb.net]
> Sent: Monday, December 23, 2002 2:30 PM
> To: NYPHP Talk
> Subject: Re: [nycphp-talk] PHP in production on Microsoft IIs
>
>
> Good luck, buddy.
> Perhaps if you told us what exactly this ColdFusion code did, some of us
(in
> our free time) could help you write some code... I'm always willing to
help
> in my spare time.
> Let me know,
> -Bradley
>
> ----- Original Message -----
> From: "Alan T. Miller" <amiller at hollywood101.com>
> To: "NYPHP Talk" <talk at nyphp.org>
> Sent: Monday, December 23, 2002 11:50 AM
> Subject: Re: [nycphp-talk] PHP in production on Microsoft IIs
>
>
> > Thanks Jessica,
> >
> > I'll be sweatin it either way :)
> >
> > Alan
> >
> > ----- Original Message -----
> > From: "jessica kelly" <jkelly at sussex.cc.nj.us>
> > To: "NYPHP Talk" <talk at nyphp.org>
> > Sent: Monday, December 23, 2002 8:42 AM
> > Subject: Re: [nycphp-talk] PHP in production on Microsoft IIs
> >
> >
> > > IIS is a four letter word as far as I'm concerned. Also everyone needs
> to
> > realize that as web/PHP developers we are often stuck with what we have,
> not
> > what we would rather have. If IIS didn't have such a sordid security
past
> we
> > would be running it here and I would have absolutely no say in the
matter.
> I
> > wanted to put Linux on the server and they put Advanced Server 2000 on
it.
> I
> > scream, yet no one hears...
> > >
> > > The site is for a very small community college and it gets very few,
if
> > any, concurrent hits on the PHP/MySQL portion of it and I have plenty of
> > room for multiple users config wise.
> > >
> > > I still think that Alan should use CGI instead of the module. It is
> flaky.
> > >
> > > Thank's Guys
> > > Jessica
> > >
> > > >>> zala007 at hotmail.com 12/23/02 10:44:09 AM >>>
> > > Miss/Mrs. Jessiaca Kelly,
> > >
> > > Better to use PHP and related softwares on Linux machine rather than
on
> > > Microsoft based OSs :) ? This is like running your Ferrari car on
Diesel
> > > rather than on Gas.I really wonder. Hard to change everything, once
set
> up
> > on Window's
> > > environment but "Better" to move on Linux.
> > > Thanks,
> > > Anirudh Zala
> > > >>>
> > > I suggest running IIS and PHP on Windows 2000 Server, or Advanced
> Server.
> > > There may be a couple configuration things you might want to look
> into...
> > > (how many users at a time? etc, etc)
> > > Also, you're going to want to look into MySQL's (or whatever other
> > database
> > > you're using) configuration, too... (again, amount of users at the
same
> > > time)...
> > > Those are the only real obvious things I can think of, if I can come
up
> > with
> > > anything else, I'll be sure to let you know.
> > > Good luck.
> > > -Brad.
> > >
> > > >From: "jessica kelly" <jkelly at sussex.cc.nj.us>
> > > >Reply-To: talk at nyphp.org
> > >
> > > >
> > > > > Eventually, both IIS and Cold Fusion will be gone, I just need to
> work
> > > > > around some of it for now and we only have one production server
at
> > the
> > > > > moment to mess around with. I would really like to know if the
> > > > >phpisapi.dll is relatively stable, and would like to hear if anyone
> has
> > > >actually used
> > > > >it in a production environment.
> > > >
> > > >Alan,
> > > >
> > > >I use the module on a apache server 1.3.xx on a Win Advanced Server
> 2000
> > > >and it is a bit flaky at times. It seems to just stop working. The
site
> > > >does not get a lot of hits and the PHP seems to crap out when you
need
> to
> > > >enter info into a MySQL DB. This doesn't happen often but about once
a
> > week
> > > >and is frustrating the person entering the data (myself also!).
> > > >
> > > >I have been told to avoid using the module from persons on this list
> > > >(Thank's Daniel!) because of this and am currently trying to get it
to
> > work
> > > >as CGI on my test server then I'll switch the other server over.
> > > >
> > > >Jessica
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> >
> >
> >
> >
> >
> >
>
>
>
>
>
>
>
>
> --- Unsubscribe at http://nyphp.org/list/ ---
>
>




More information about the talk mailing list