Uploading pictures to a database

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jayluda
Forum Newbie
Posts: 9
Joined: Tue Aug 02, 2005 10:51 am

Uploading pictures to a database

Post by jayluda »

I need people to upload their pictures when they register in a form. Can pictures be uploaded to mysql database. If yes, how?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

yes.. not a good idea though. It's best to store the files within the file system and let mysql manage a link to it.
jayluda
Forum Newbie
Posts: 9
Joined: Tue Aug 02, 2005 10:51 am

mysql managing a link to the picture?

Post by jayluda »

how do i go about it? how does mysql manage a link to it?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

there've been a lot of posts here about this, please search.
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

If you searched, you might have ran across my tutorial

viewtopic.php?t=35972

It walks you through uploading an image to a database, and if you'd like you could include a query to insert the filename to a database, to use that for your link.
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Post by josh »

scrotaye wrote:If you searched, you might have ran across my tutorial

viewtopic.php?t=35972

It walks you through uploading an image to a database, and if you'd like you could include a query to insert the filename to a database, to use that for your link.
Just read your tutorial, don't like to bump old things so I'll say it here:
You really should be checking mime types not extensions, you should say that in your tutorial too.
Post Reply