See the manual for uploading.
<form action="file-upload.php" method="post" enctype="multipart/form-data">
Send these files:<br>
<input name="userfile[]" type="file"><br>
<input name="userfile[]" type="file"><br>
<input type="submit" value="Send files">
</form>
After you have the image in your server, you must update the table.
Try this code (modify it!).
To upload:
<?php
$db_name = "whatever";
$table_name = "meta"; // Your table Name
$field_name = "imagen";
$filename = "whatever.jpg"; // Put here your file
$fd = fopen ($filename, "r");
$contents = fread ($fd, filesize ($filename)); //Read de contents of the file
fclose ($fd);
$contents = addslashes($contents); //Scape characters
$conex = mysql_connect("localhost", "root", "");
mysql_select_db($db_name, $conex);
$sSql = "insert into " . $table_name . "(" . $field_name . ") values ('" . $contents . "')";
$result = mysql_query($sSql, $conex);
?>
-- To retrieve the image:
<head>
<title>Images</title>
</head>
<body>
this is a demonstration of how to retrieve a image from a BLOB field in MySql:
<!-- Put here the id of your image just inserted -->
<img src='get_image.php?codigo=8'>
</body>
</html>
<?php // get_image.php
$db_name = "whatever";
$table_name = "img"; // Your table Name
$field_name = "IMAGEN";
$key_name = "cod"; // Put here your key field
$conex = mysql_connect("localhost", "root", "");
mysql_select_db($db_name, $conex);
$sSql = "SELECT " . $field_name . " FROM " . $table_name . " where " . $key_name . " = " . $codigo;
$result = mysql_query($sSql, $conex);
$fila = mysql_fetch_array($result, MYSQL_ASSOC);
//ob_start();
header ("Content-type: image/gif");
echo $fila[$field_name];
//ob_end_flush();
?>