Hi, I am having trouble uploading some text and an image to a MYSQL database via a form. I can upload the text fine but "no go" with the image. I am not a great PHP coder so I wouldn't be suprised if this is all wrong. Any help would be greatly appreciated. I'm not too worried about security at the moment thats why I have got the connection settings in there. Here is the code I have been using... ============================================================= <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <? if($_POST['submit']) { mysql_connect("host","user","pass"); mysql_select_db("db") OR DIE ("Unable to select db".mysql_error()); $id = $_POST['id']; $description = $_POST['description']; $date = $_POST['date']; $imgData = addslashes(fread(fopen($_FILES['userfile']['tmp_name'], "r"), filesize($_FILES['userfile']['tmp_name']))) or die("Could not open file."); $result=MYSQL_QUERY("INSERT INTO table (id, description, date, image, filename, filesize, filetype)". "VALUES ('$id','$description','$date','$imgData','$_FILES['image']['filename']','$_FILES['image']['filesize']','$_FILES['image']['filetype']')"); } ?> <font face="verdana"> <h3><center><u>Add Equipment Record</u></center</h3> <form enctype="multipart/form-data" action="" method="POST"> <TABLE WIDTH="100%" CELLPADDING="10" CELLSPACING="0" BORDER="2" RULES=NONE FRAME=BOX BGCOLOR="#FAEBD7"> <col span="1" align="right"> <TR> <TD><font face="verdana"><b>Equipment ID:</b></font></TD> <TD><INPUT TYPE='TEXT' NAME='id' VALUE='' size=60></TD> </TR> <TR> <TD><font face="verdana"><b>Description:</b></font></TD> <TD><INPUT TYPE='TEXT' NAME='description' VALUE='' size=60></TD> </TR><br> <TR> <TD><font face="verdana"><b>Date:</b></font><br><font face="verdana" size="1"><left>(yyyy-mm-dd)</left></font></TD> <TD> <INPUT TYPE='TEXT' NAME='date' size=60> </TD> </TR> <tr> <td><font face="verdana"><b>Image:</b></font></td> <td><input type="hidden" name="MAX_FILE_SIZE" value="2000000"><input name="userfile[]" type="file" class="box" id="userfile"></td> </tr> <tr> <td> </td> <td><input name="upload" type="submit" id="upload" value="Submit"></td> </tr> </TABLE> </form> </font> </body> </html> ============================================================= Thanks for any help