Share your knowledge at the LQ Wiki.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 04-29-2010, 08:54 AM   #1
Senior Member
Registered: Mar 2008
Location: Cyberspace
Distribution: Dynebolic, Ubuntu 10.10
Posts: 1,340

Rep: Reputation: 62
How to store pictures in a MySQL database in PHP

How do I do this? I wish to store the pictures via a "Browse" button on the webpage, and later display them on a particular page on the site.

Old 04-29-2010, 08:59 AM   #2
Registered: Feb 2010
Distribution: gentoo, arch, fedora, freebsd
Posts: 379

Rep: Reputation: 97
You can use blob type.
However, I can't recommend it. The pictures better to store on hdd in most cases.
Old 04-30-2010, 12:02 PM   #3
Registered: Aug 2003
Location: Glasgow, Scotland
Distribution: Slackware 14.0, Debian 7.0
Posts: 60

Rep: Reputation: 22
I looked into this last year for a small website to allow uploading photos to a website. From the research I found that the majority of people said to avoid putting images into databases unless absolutely necessary, it is a much better practice to upload/store the picture in a directory or wherever and then just store the path and filename in the DB.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Store Network Traffic in MySql Database ??? sanketdangi Linux - Server 6 03-07-2010 08:29 PM
store list items written in cgi script to mysql database gsr_kashyap Programming 5 01-28-2009 01:08 AM
Trying to get PHP to connect to a MySQL Database bassplayer69 Programming 16 03-13-2008 09:27 PM
How to configure Sendmail to store mail in a MySQL database moenterprise Linux - Server 0 08-24-2007 11:59 PM
Store IMAP emails in mySQL database dlublink Linux - Networking 1 01-07-2005 04:00 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:55 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration