
June 1st, 2006
04:26 PM
Neverside Newbie
Status: Offline!
Insert images into DB
Hi Everybody
I Just recently learnt how to use mySQL so I know I've still got alot to learn. I've been searching all over to try and find out exactly how to insert an image into the mySQL database and I havent found anything yet.
I hope you guys can help.
Thanks

June 2nd, 2006
08:41 AM
Neverside Newbie
Status: Offline!
Are you sure you want to do that? Why not just store the images on the server and save the location in the database its alot less overhead in the database.
but here is a tutorial to do save the images into the db. http://hockinson.com/index.php?s=37
___________________
www.sp0rk.com

June 2nd, 2006
09:23 PM
Neversidian
Status: Offline!
Yeah It's usually better to just let the file system take care of images rather than the db.
___________________
Neverside Development Director
PHP Snippets
BigToach.com - IT WORKS, TOACHY!

June 3rd, 2006
01:52 AM
funny and cheeky
Status: Offline!
why would u want to save a image into db in the first place? I never seen an actuall image store into a db
Last edited by schoi, June 3rd, 2006 01:53 AM (Edited 1 times)

June 3rd, 2006
05:57 AM
Oh Yeaa.
Status: Offline!
you dont have to chmod anything, thats one reason...
___________________
scudworkz.com.

June 3rd, 2006
01:46 PM
Neversidian
Status: Offline!
lol, it can make them easier to manage, the read time of a db is faster than the filesystem, and makes them easier to protect as well. Bandwidth and transfer time still are the bottleneck and you can always manage and protect images just as well out of the db
___________________
Neverside Development Director
PHP Snippets
BigToach.com - IT WORKS, TOACHY!

June 3rd, 2006
02:05 PM
Originally posted by schoi:
why would u want to save a image into db in the first place? I never seen an actuall image store into a db
Yeah agree... ask vBulletin though, they used to do that, not sure if they do now though.

June 3rd, 2006
06:42 PM
funny and cheeky
Status: Offline!
really oh nah I dont think it's worth it because the amount of bandwidth it must take. Not to mension if it's a busy site it would put alot of pressure on the db server. Chmoding isn't exactly rocket science.

June 5th, 2006
08:06 AM
Nobody fucks with my title.
Status: Offline!
Originally posted by BigToach:
lol, it can make them easier to manage, the read time of a db is faster than the filesystem, and makes them easier to protect as well. Bandwidth and transfer time still are the bottleneck and you can always manage and protect images just as well out of the db
How can the read time of a database be faster than that of a filesystem? When you get down to it, databases are stored on the filesystem. Unless it's somehow cached into memory constantly (insane idea, especially with large images), there's no way the speed of sending an SQL query to a database, retrieving the BLOB result, and spitting that out as an image can be faster than just linking to the file on the filesystem.
___________________
<3

June 5th, 2006
12:49 PM
Neverside Newbie
Status: Offline!
Then how would you get the browser to display the image if you only have the path stored in the db