Hello,
I have a mySQL database administered through MyphpAdmin. The database is connected to a PhP page built in Macromedia Dreamweaver. I can view the data in the database through my created Dreameaver Dynamic page. So far so good.
I now want to add some pictures to this database. I want to add another column to each field and place a small jpeg or gif file in there.
Through the MyPHPadmin tools, I simply added another column called image and set it to type Mediumblob., attributes then set to BINARY.
I was then able to browse to a file, and select it. Viewing my table, it seemed as though the file was in there, as the file size was displayed (however that was the only indicator that the database was populated with the image).
Then I tried to add this dynamic image to my created web page but when I tried to preview it in my browser, instead of the image I got lines and lines of symbols (more than a page - not readable)
What my question is, is whether or not the images have been correctly stored into the database or not. If not, this will be why they don't seem to be displaying properly. I've spent the day trying to solve this one. and my searches have usually given me some PHP coding tips or a solution that seems too complicated.
I don't really know, but I would have thought that this could be easily done with MyPHPAdmin. The images are stored locally, and only I will add them to the database manually. I imagine that if I wanted to set it up so users can upload photos to my database some PHP coding may be required, but for my purpose, surely it can be done in PHPMyAdmin?
Please, if anyone has any opinions or advice on these, I would be very grateful to hear it. Even if images can't be added through MyPhpadmin and I have to write some php manually, at least I will know what I must do.
Thanks for reading this.
Cheers,
Adam