Har fundet lidt her se om du kan bruge det. Nederst på siden
http://www.mysql.com/doc/E/N/ENUM.htmlEmz Kolin: How will i use insert to store a large data, i.e. a picture, in mysql using blob type?
Emz Kolin: How will i use insert to store a large data, i.e. a picture, in mysql using blob type?
Jason Sibre: For information about inserting binary data into BLOB columns, see section '6.1.1.1 - Strings'
Víctor Ponz: If you want to insert an image in a BLOB field you must do: 1.- To insert the image in the field:
?php $filename = "25.gif"; // your filename
$fd = fopen ($filename, "r");
$contents = fread ($fd, filesize ($filename));
fclose ($fd);
$contents = addslashes($contents);
$conex = mysql_connect ("localhost", "root", "");
mysql_select_db($db, $conex);
$sSql = "insert into TABLE (FIELD) values ('" . $contents . "')";
$result = mysql_query($sSql, $conex);
2.- To retrieve the image:
php header ("Content-type: image/gif");
$conex = mysql_connect ("localhost", "root", "");
mysql_select_db($db, $conex);
$sSql = "SELECT FIELD FROM TABLE";
$result = mysql_query($sSql, $conex);
$row = mysql_fetch_array($resultado, MYSQL_ASSOC);
ob_start();
echo $row['IMAGEN'];
ob_end_flush();
3- If you want to include the image in an HTML page, just include an IMG Tag (supossing you have saved the script above as get_image.php) like this:
<img src='get_image.php'>