images php coding issues or problems here.
Moderators: macek, egami, gesf
I need some general information to get started.
I have a site I'm working on as a project - consider it a mini-facebook or something if you need a reference. Users register, have profiles, etc.
I need to be able to allow users to upload photos. My question - should I be uploading the photos and storing them in mysql, or (and I assume this is the better option) uploading them to the file system, and referencing them in mysql?
Assuming the second is the better option, can anyone point me in a direction to get started?
Any thoughts would be appreciated. Thanks.
- New php-forum User
- Posts: 1
- Joined: Tue Nov 02, 2010 7:15 am
the second is the better option.
in your images table, just have a field where you can reference your user and their pictures.
/var/www/images/mysite/* is your images directory.
your mysql table is called images
table has the following fields..
img_id is your key
img_userid is your key to assoc the user
img_name is the name of the file uploaded into the /var/www/images/mysite directory
img_uploaded is the datetime stamp when it was actually uploaded.
Then you can map the links of the photos, call them whenever needed, etc.etc.etc.
- php-forum GURU
- Posts: 2197
- Joined: Wed Oct 06, 2010 11:19 am
- Location: Happy Valley, UT
Return to PHP coding => Images
Who is online
Users browsing this forum: Google [Bot] and 1 guest