How can I enter images into a MySQL database correctly through my MyPhPadmin?
Posted on 2004-11-02
I have set up a dynamic database using Macromedia Dreamweaver, MySQL and MYPHPadmin and have managed to connect to my database through Dreamweaver, and am able to see the data when I preview my webpage. All's well there.
I now want to add images into my MySQL Database. I have tried to do this by entering another column in my table (through MYpHpadmin) and setting it to type 'LONGBLOB'. Attributes were then set to BINARY - (automatically, I think).
I then edited the field as per usual, and browsed (still in MyPHPAdmin) to my image on my local computer. (My MySQL and MyPhpAdmin are stored on a remote server).I seemingly selected an image and pressed 'GO'. The image seemed to go into the database as the filesize was then dispalyed in the appropriate column for the appropriate field in the table (although I could see no other evidence that it was actually in there).
Through Dreamwaver, I then linked a placed image to this column on the database (selecting it through a set-up recordset) but when I tried to view this in my browser, instead of my nice little image, I saw lines and lines of nonsense (non-decipherable letters and symbols).
Have I entered the images into the Database correctly? Any help / opinions on the matter would be greatly appreciated.