I have an upload form. After the upload form, I have this code in PHP:
$filename = $_FILES["photo"]["tmp_name"];
$destination = "hr/upload/" . $_FILES["photo"]["name"];
move_uploaded_file($filename, $destination);
$_SESSION['FORM_image'] = $destination;
This code uploads the photo on the destination directory and inserts the path in a session variable.
Now, I want to upload this photo (the uploaded photo) in a MySQL database but my attempts fail.
I tried to use functions like fopen() and similar, but it still not working.
UPDATE: Sorry, perhaps I have not explained well: the upload form and the upload on MySQL are two separated actions. The form uploads the photo on the remote directory. Then I want to "move" this photo from the remote directory to MySQL database.
Can anyone helps me?