I am trying to upload a image from my html form to my mysql blob column. I feel like the php file isn't receiving the file based off of all the testing to try to figure out what is not working.
relevant HTML code:
<form action = "insert.php" method="post" enctype="multipart/form-data">
<input type="file" name="myimage">
<input type="submit" name = "Insert" value="Insert">
</form>
relevant PHP code:
$imagename=$_FILES["myimage"]["name"];
if(getimagesize($FILES['myimage']['tmp_name']) == FALSE){
echo "no image";
}
//Get the content of the image and then add slashes to it
$imagetmp = addslashes($_FILES['myimage']['tmp_name']);
$image = file_get_contents($imagetmp);
$sql = "INSERT INTO locations (image) VALUES ('$image')";
$res = mysql_query($sql) or die(mysql_error());
I believe the php isn't recieving the file because I always get my "no image" echoed.