tags:

views:

97

answers:

2

i want to display my images which are located in a mysql database in a browser using php , myadmin

// exactly i am talking about wampserver/

now ho do i retrieve images from database in a browser using php

+2  A: 

Here is good example: http://www.phpriot.com/articles/images-in-mysql/8 .

Y. Shoham
+1  A: 

Personally I tend to go for keeping images in the filesystem and just storing a reference to the path in the database. I do this for 2 reasons:

Firstly, it's easier to update the images on the fly if neccessary, just upload the new one

Secondly, if you have lots of big images they're gonna slow down your database

I would also guess that its slightly quicker to display the image if it is a file rather than having to load the data from the db first but that is just a guess - I haven't done any testing to confirm it.

That said, I can see that there are valid reasons for wanting to keep them in the db, for example if you want to be able to do a backup of the database and include actual image data in this backup.

I would recommend checking whether you definitely need the actual image data in the database and if not just store a reference to its path and keep the image in the filesystem

Addsy