Inserting images into a database?

See this howto However, you should really consider using parametrized queries instead of passing the query arguments inline.

See this howto. However, you should really consider using parametrized queries instead of passing the query arguments inline.

Great link. But now I am a bit confused. Should I store the complete image in the db or assign an ID to it and then call it via the ID?

Thanks – brad Nov 21 '10 at 6:04 Most DBAs recommend against storing large blob data like images in a database, as it will unnecessarily tax the database server every time you need to fetch an image out. There are two ways to approach this: store the files in a directory inside the webroot so the web server can host them as-is, or store them somewhere else and use a script to serve them up (e.g. Image. Php?

Id=xxx). Either way, yes, change the actual file name to the id of the image in the DB, or come up with some other way to map database entries to filesystem entries. – cdhowie Nov 21 '10 at 6:07 @brad: its rare youll ever actually want to store the image itself in the db.

Jsut store the path on the filesystem. Then when you go do display it transform that filesystem path to the public path tot he image. – prodigitalson Nov 21 '10 at 6:08 Whoa!

Really informative. I like the idea of assigning an ID to every image. Can you provide me another useful link that would help me assign ID to images like (e.g. Image.

Php? Id=xxx) – brad Nov 21 '10 at 6:09 @brad: Just use an autonumber primary key column. After you insert the row, check the ID that was just added.

There's your key. And note that, if possible, you should store those files in the web root so that you don't have to use a script. Using a script to serve static image data creates more unnecessary overhead.

– cdhowie Nov 21 '10 at 6:10.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions