I am having trouble getting my code to work with my database. I'm almost certain its just punctuation because the video our professor gave us was too small. I am using the blob type and the images are less than 1mb. This is what I have and its just the last few items I am trying to put in the database that arent functioning. Its telling me that I can't use empty values. These are the errors I am getting:
Warning: fopen() [function.fopen]: Filename cannot be empty in /home/wequpstu/public_html/admin/portfolioForm.php on line 100
Warning: fread() expects parameter 1 to be resource, boolean given in /home/wequpstu/public_html/admin/portfolioForm.php on line 101
Warning: fclose() expects parameter 1 to be resource, boolean given in /home/wequpstu/public_html/admin/portfolioForm.php on line 102
$handle = fopen($_FILES['imgPhoto']['tmpName'], "r");
$image = fread($handle, filesize($_FILES['imgPhoto']['tmpName']));
fclose($handle);
$image = mysqli_real_escape_string($dbConnection, $image);
mysqli_query($dbConnection, "INSERT INTO portfolio (title, shortDescription, longDescription, image, imageName, imageType, imageSize) VALUES ('$_POST[txtTitle]', '$_POST[txtShortDescription]', '$_POST[txtLongDescription]', '$image', '" . $_FILES['imgPhoto']['name'] ." ', ' " . $_FILES['imgPhoto']['type']. " ', '" . $_FILES['imgPhoto']['size']."' )");
echo "<p style=\"text-align: center; font-size: 11px;\">Thanks for filling out form!</p>";
echo "</fieldset></form>" ;