PDA

View Full Version : Storing Image into database



devil_vin
09-25-2007, 06:36 AM
Hi..guys.How can I achieve to storing image into database?Is it necessary to create another table or able to mix with a table which store plain data?Thanks..

codeexploiter
09-25-2007, 07:09 AM
You can achieve this by using Binary based data type that are available in modern RDBMS tools like Oracle or MySql; for example BLOB data type.

You can keep the images as a field in your table, which means a table can have textual based data as well as binary based data.

But before the storage of images in the database please make sure that the storage won't affect the performance of your application or rather your application needs the database storage.

As you haven't mentioned your database tool in your posting it is not really simple to comment on the issue

boogyman
09-25-2007, 01:22 PM
dont store the actual image, you should be storing the location of the image, then you can test for existance later.

devil_vin
09-25-2007, 02:00 PM
You can achieve this by using Binary based data type that are available in modern RDBMS tools like Oracle or MySql; for example BLOB data type.

You can keep the images as a field in your table, which means a table can have textual based data as well as binary based data.

But before the storage of images in the database please make sure that the storage won't affect the performance of your application or rather your application needs the database storage.

As you haven't mentioned your database tool in your posting it is not really simple to comment on the issue


Thanks for reply.I am using xampp+PHP+MySQL combination

codeexploiter
09-26-2007, 04:50 AM
http://www.phpriot.com/d/articles/database/images-in-mysql/
http://www.phpbuilder.com/columns/florian19991014.php3

insanemonkey
09-26-2007, 05:41 AM
I dont think you should store images in a database becuase it could slow your db down or take alot of memory, it would probably be easier if you just uploadd it to a file and made it so it posted the url into the db..