
June 5th, 2006
03:38 PM
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!

June 7th, 2006
08:31 AM
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

June 7th, 2006
02:49 PM
Neverside Newbie
Status: Offline!
Thanks alot everyone I think I got everything working and I'll post the url once it is done


June 8th, 2006
07:41 PM
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? 

June 8th, 2006
09:24 PM
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!

June 9th, 2006
11:50 AM
Neverside Newbie
Status: Offline!
Great so if I understand correctly I can just backup the database and restore it on the server.

June 10th, 2006
10:19 AM
Neversidian
Status: Offline!
yeah
___________________
Neverside Development Director
PHP Snippets
BigToach.com - IT WORKS, TOACHY!

June 10th, 2006
07:22 PM
whoa, wtf?
Status: Offline!
mysql -u [username] -p [databasename] < backup.sql
(will prompt you for your password)
___________________
Fomerly known as lasnaranjas. Holler.
