Forum Moderators: coopster
I just asked a similar question, and received an answer, in this thread [webmasterworld.com].
Basically upload the file, and use the LOAD_FILE() MySQL function to dump into your table's blob type field. Getting it out in picture form requires your PHP to be configured with the "GD" libraries, and various other image-related things. Find out all about it, here. [boutell.com]
Enjoy the forums! :)
Thanks for tips but.... am so new to all this kind of thing , so can u tell plz , at the moment all i wanted to know is just to make a "Mysql database" that stores "Picutre" & "Description" on two tables i need, right now i dont need php form, just to store pic and the description..
\\Pic\\Description\\
\ \\ \\
\\ \\ \\
table pictures
picture_id int(10) - primary key
file_path char(255)
description char(255)
Then I use that information to find the file on the filesystem.
mysql> use test; Database changed mysql> describe blobber; +--------+---------+------+-----+---------+----------------+ ¦ Field ¦ Type ¦ Null ¦ Key ¦ Default ¦ Extra ¦ +--------+---------+------+-----+---------+----------------+ ¦ id ¦ int(11) ¦ ¦ PRI ¦ NULL ¦ auto_increment ¦ ¦ picbox ¦ blob ¦ YES ¦ ¦ NULL ¦ ¦ ¦ info ¦ text ¦ YES ¦ ¦ NULL ¦ ¦ +--------+---------+------+-----+---------+----------------+ 3 rows in set (0.00 sec) You can store pictures in one of two ways: as a path to the file, as suggested, or as a text string in a text or blob MySQL field.
In my test table, I store the string version of the picture in the "picbox" field, and the path to the actual image file in the "info" field.
Here's a small piece of what it looks like in the database:
select * from blobber limit 1; +----+------------------+-------------+ ¦ id ¦ picbox ¦ info ¦ +----+------------------+-------------+ ¦ 1 ¦ Gif89ai?D?x^.etc.¦ /image.gif ¦ +----+------------------+-------------+ I use PHP to send the instructions to "LOAD_FILE('/image.gif')" to put the picture data into "picbox", but you can do it from a terminal or (probably) using one of the graphical MySQL managers.
Try just storing and using the path to the image file while you learn, Butterfly_Wing. If you use the "picbox" method of storing the picture file data, you need to do a bunch of other stuff to your PHP installation to get it to work.