How to Upload a picture in server/mysql and retrieve?

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
monir321
Forum Newbie
Posts: 1
Joined: Wed Nov 16, 2011 8:41 am

How to Upload a picture in server/mysql and retrieve?

Post by monir321 »

Dear Friends,

This is Monir from Malaysia, I am really happy to be a member of this group.

I am searching some code or tutorial regarding to upload picture in servers local directory or in Mysql Database and retrieve with some information like ID or Name and view in PHP webpage?

I already have tried with some tutorials but it wont work.

Please help.
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: How to Upload a picture in server/mysql and retrieve?

Post by Celauran »

What have you tried and what doesn't work?
Hermit TL
Forum Commoner
Posts: 69
Joined: Mon Nov 21, 2011 12:16 am

Re: How to Upload a picture in server/mysql and retrieve?

Post by Hermit TL »

Thought I have never actually done this, if I was allowing users to upload images, I would opt for storing it in a MySQL database as a BLOB
Like Celauran said, it would help us greatly to know what you have already tried and what and/or why it doesn't work.

Maybe: http://www.phpriot.com/articles/images-in-mysql

And welcome to the forums! I love this place!
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: How to Upload a picture in server/mysql and retrieve?

Post by pickle »

Do not store images in a MySQL database. I understand the appeal, but it really slows down the site. The filesystem is built to handle files, so that's where they should be stored.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Hermit TL
Forum Commoner
Posts: 69
Joined: Mon Nov 21, 2011 12:16 am

Re: How to Upload a picture in server/mysql and retrieve?

Post by Hermit TL »

Do not store images in a MySQL database
lol, and the war rages on... (Hermit TL gracefully steps aside after his final statement on this)

Whether or not you choose to store images in the MySQL database, do your own research and come to your own conclusion, it's a heavily debated topic.
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: How to Upload a picture in server/mysql and retrieve?

Post by pickle »

Hermit TL wrote:do your own research and come to your own conclusion
Always a good idea.

As long as you come to the same conclusion as me *wink*
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Post Reply