Reply
How to store images with links in mysql database and how to....
Old 07-30-2009, 02:01 AM How to store images with links in mysql database and how to....
Junior Talker

Posts: 3
Name: Paul
Trades: 0
I was planning to set up a website for a bunch of ebooks that displays each ebook images, descriptions, and download links in a row. I know that doing it in php with mysql is the best way to go. But I've been tormentedly figuring out how should it be done. I would greatly appreciate any words from you guys. Thanks! \m/
paolo0911 is offline
Reply With Quote
View Public Profile
 
 
When You Register, These Ads Go Away!
Old 08-04-2009, 11:12 AM Re: How to store images with links in mysql database and how to....
nayes84's Avatar
Extreme Talker

Latest Blog Post:
Difference between ASP And JSP
Posts: 153
Name: John
Location: Tokyo
Trades: 0
do you want to store images in mysql database. or store them in files and just store the link in the database?
__________________
Upload Your Photos For Free | Submit Website To ePhoto Bay
ASP VS JSP
| Free Online Galleries
If I'm("Helpful") Then Add_Talkupation("nayes84") End If
nayes84 is offline
Reply With Quote
View Public Profile
 
Old 08-07-2009, 04:55 AM Re: How to store images with links in mysql database and how to....
Brian07002's Avatar
Defies a Status

Posts: 1,824
Name: ...
Location: ...
Trades: 0
@Paul & Maria2009

You can do it pretty easily if you signup for free webhosting. Bear in mind, the freehost will require at minimum: 1 free mysql database. Once you have that, and by the way if you pay for hosting that should be part of your package, and you will likely have access to more than one mysql database as well.

Once you have that, you log into the servers control panel, and you will see a link to the Mysql section. From there it's all yours. It will take some time to learn, but that's where you will NEED to learn this stuff from.

Hth,
-Brian
Brian07002 is offline
Reply With Quote
View Public Profile
 
Old 08-09-2009, 06:01 AM Re: How to store images with links in mysql database and how to....
Super Talker

Posts: 101
Trades: 0
It is always the good practice not to store images to the database. Because as the more rows are getting added to the database, your database server performance will go down. Hence, you should store the images on the file system and just save the link to the image in the database.

All popular application saves the attachments this way, The best example is Kayako helpdesk software.
__________________
AccuWebHosting.Com - Windows Hosting Expert
ASP.NET 3.5 | SQL 2005 Database | US Based Hosting Company | 24 X 7 Support | Daily Backups | Uptime Guarantee | Affiliates - $50 Per Sale
| Website Hosting
twhdir is offline
Reply With Quote
View Public Profile
 
Old 08-09-2009, 02:37 PM Re: How to store images with links in mysql database and how to....
nayes84's Avatar
Extreme Talker

Latest Blog Post:
Difference between ASP And JSP
Posts: 153
Name: John
Location: Tokyo
Trades: 0
Quote:
Originally Posted by twhdir View Post
It is always the good practice not to store images to the database. Because as the more rows are getting added to the database, your database server performance will go down. Hence, you should store the images on the file system and just save the link to the image in the database.

All popular application saves the attachments this way, The best example is Kayako helpdesk software.
but on the other hand, storing images in files then just storing the links in database can be troublesome when transferring website. because you need to keep up file structure the same. mostly at each move there are always some bugs that comes up either with lost files or deformed files structure due to different file system or whatever.
other trouble, is files permissions. you need to set them probably or images will not be created or deleted or even will not be accessed.

in short, if images are just few thousands it is better to have them up in the database to avoid the kinks comes up with file system
__________________
Upload Your Photos For Free | Submit Website To ePhoto Bay
ASP VS JSP
| Free Online Galleries
If I'm("Helpful") Then Add_Talkupation("nayes84") End If

Last edited by nayes84; 08-10-2009 at 01:31 AM..
nayes84 is offline
Reply With Quote
View Public Profile
 
Old 08-09-2009, 07:38 PM Re: How to store images with links in mysql database and how to....
tripy's Avatar
Do not try this at home!

Posts: 3,418
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
Quote:
Originally Posted by twhdir View Post
It is always the good practice not to store images to the database. Because as the more rows are getting added to the database, your database server performance will go down. Hence, you should store the images on the file system and just save the link to the image in the database.

All popular application saves the attachments this way, The best example is Kayako helpdesk software.
No, it should not....
If you design your db well enough, it sure will take some milliseconds more, but the "performances" won't degrade.

Beside, saying that pictures should always be stored outside a db is just a myth, and can be misleading.
I have programmed a web service that takes screenshots of web pages, and I do not store them as files.
I store them in a postgresql DB and in a memcached server instance.

Why !?
Because the db adds only a minor overhead, if no overhead at all. Mind you, the filesystem management is an overhead too...
Because I can have several server working together, and having files shared between them is just like sleeping under an anvil, something is bound to happen. Be it name conflict, locking error or network problems.

So, storing files in a DB can be a well more suitable way to handle them than a filesystem only one.

But as for the OP question, it's true that storing the pics in the DB would be overkill.
But if your question still torment you, there is a good article there: http://www.phpriot.com/articles/images-in-mysql
__________________
Only a biker knows why a dog sticks his head out the window.

Last edited by tripy; 08-09-2009 at 07:40 PM..
tripy is online now
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 08-20-2009, 10:49 PM Re: How to store images with links in mysql database and how to....
Junior Talker

Posts: 1
Name: katenlee
Trades: 0
Life is too short to be serious, laugh it up.



gratuit pour mobile sonnerie portable mp3 - Sonnerie portable MP3 est en effet un pouvoir de l'innovation technologique. Ętes-vous familier avec cette sonnerie portable?gratuit pour mobile sonnerie portable mp3
katenlee is offline
Reply With Quote
View Public Profile
 
Old 08-21-2009, 03:33 AM Re: How to store images with links in mysql database and how to....
tripy's Avatar
Do not try this at home!

Posts: 3,418
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
At least 8 times a day !
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is online now
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 09-08-2009, 08:10 PM Re: How to store images with links in mysql database and how to....
Average Talker

Posts: 27
Trades: 0
it is not a good idea, it will make you database extend rapidly!
tmjacsone is offline
Reply With Quote
View Public Profile
 
Old 09-10-2009, 03:56 AM Re: How to store images with links in mysql database and how to....
tripy's Avatar
Do not try this at home!

Posts: 3,418
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
So what !?
Why would it be a problem ?
Either you make your db grow, or you fill your hdd, so what's the difference ?

Clean up your db, remove old, unused data, prevent duplication, and it won't be a matter.
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is online now
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Reply     « Reply to How to store images with links in mysql database and how to....
 

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.12462 seconds with 13 queries