Welcome Guest, Not a member yet? Register   Sign In
How do I display an image in mysql
#1

[eluser]farocco[/eluser]
Hello,

I have images stored in mysql that I want to display in a list.
The format is a blob.

I cannot get this to work.
#2

[eluser]JHackamack[/eluser]
Do you have sample code that you can post?
#3

[eluser]farocco[/eluser]
<img height="100" width="100">image?&gt;"

Thanks
#4

[eluser]JHackamack[/eluser]
I believe you might need something like:
Code:
src='data:image/png;base64,&lt;?php echo $image; ?&gt;' alt="Red dot"

If your image is a png and base64 encoded.
#5

[eluser]farocco[/eluser]
<img height="100" width="100" alt="red dot">image?&gt;">

Still not working
#6

[eluser]JHackamack[/eluser]
What is the HTML being output in your view?

And I see you don't have a SRC tag, which is required
#7

[eluser]farocco[/eluser]
My code is getting mangled. I do have a src tag.

How can I paste the code to show?

E•–x¦N ààçÐüØÁÆ)ûIwDvMc6HòÇ÷JŸÓ9ý*¼°˜ÛlˆQ½`þ´ºmùº°²¼>t1˹ŽC'ó8®/ÂWóéÞ/ñ$:…»?Ú";•„C'ûÌ8Ã(À9ã5J«êK‚èuÅG ü©¥ì?*°ÿ?Ý·º„Ÿáp~a‰­BÙ A08*F h¤žÄ¸µ¹"úʘQyà~U+uÅ1ª™$EÐ~TÆEÏAùT­M
#8

[eluser]JHackamack[/eluser]
before you insert into the database do a base64_encode, then echo out the blob normally
Thus you can use the example I have in #3 with the base_64 and it should work.
#9

[eluser]farocco[/eluser]
Thank you

Any way around this with existing images?
#10

[eluser]JHackamack[/eluser]
use base64_encode around your $image blob.




Theme © iAndrew 2016 - Forum software by © MyBB