Banner

Sponsor

Login


Welcome Back!
Guest
Guest

Register

Lost your password?

63 users online



Insert images into DB

Insert images into DB

Currently viewing this thread: 1 (0 members and 1 guests)


Page 2 out of 2
BigToach

BigToach

Neversidian
Status: Offline!

echo '<img src="' . $row['path_to_image'] . '" />';

and to Noel.

First of all my opinion was to not store images in the database, with that being said: I know with the modern database system (specifically Oracle) the caching system it implements does improve speed on images that are commonly accessed. Images that are not cached are generally accessed at about the same speed as files that are accessed from the filesystem via indexes and the like. Now there are definately setbacks to this of course. The extra indexes and other db overhead make the stored image actually take up more space than just the image alone. Accessing stuff from the db increases work done by the cpu. If your db goes down, your images go with it. It can be hard to transfer images from one db to another.

Ultimate the latter reasons are the ones why I say to store the location of the image on the filesystem rather than the actual image itself. However it still is, some times at least, faster to retrieve the image from a db than the filesystem.

___________________

Neverside Development Director
PHP Snippets
BigToach.com - IT WORKS, TOACHY!

dibby

dibby

Neverside Newbie
Status: Offline!

I don't know the ins and outs of oracle caching, but it seems quite possible to me that in a specific application caching of frequently accessed portions be it page/rows/blocks of each/a table would show improve times on specific images.

I don't think it could be made as a general argument for the various reasons stated, only those that made it into the cache at ram level would benefit.

The main reason for using the db store for images, which I haven't seen mentioned here is to reduce the number of file descriptors required. Many virtual dedicated platforms ration not only cpu/ram usage but the number of file descriptors available.

___________________

Glasgow SEO

MichaelS

MichaelS

Neverside Newbie
Status: Offline!

Thanks alot everyone I think I got everything working and I'll post the url once it is done
Grin

MichaelS

MichaelS

Neverside Newbie
Status: Offline!

I'd like to say thanks again for all the help. another small problem has crossed my path though. Previously i've only worked with MS Access databases and this will be my first SQL database. When uploading an access database to the server you simply upload the .mdb file. how do you upload a SQL database? Eek

BigToach

BigToach

Neversidian
Status: Offline!

export your data as a sql dump and run that dump in the database. That is the most general way to do it anyways. If you are using MsSQL there is probably some import method or something, but running the sql dump will work just fine.

___________________

Neverside Development Director
PHP Snippets
BigToach.com - IT WORKS, TOACHY!

MichaelS

MichaelS

Neverside Newbie
Status: Offline!

Great so if I understand correctly I can just backup the database and restore it on the server.

BigToach

BigToach

Neversidian
Status: Offline!

yeah

___________________

Neverside Development Director
PHP Snippets
BigToach.com - IT WORKS, TOACHY!

phpmonkey

phpmonkey

whoa, wtf?
Status: Offline!

mysql -u [username] -p [databasename] < backup.sql

(will prompt you for your password)

___________________

Fomerly known as lasnaranjas. Holler.
http://card.mygamercard.net/gelsig/blackdood.png

Page 2 out of 2
Quick Jump:

Main Navigation


Site & Graphic Design by Aeon Tan
Developed by Jeremie Pelletier & Scott Roach


NeverAPI generated this page in 0.0075 seconds.