This question already has an answer here:
Let's go strait to the point:
I'm building a web-application with PHP5 and MySql and I have to insert some images (which are uploaded by the user) into the database;
database table: images_table ( id int(20), image blob );
form:<form action="background.php" method="post" enctype="multipart/form-data">
<input type="file" name="image">
<input type="submit">
</form>
the point is: after the form is submitted how does it work in the background.php file? I mean, how am I supposed to build an insert command and run it? How do I handle the image selected by the user?
I've seen/read many diferent codes but I lack some knowledge about the flow since the moment the user submits the form until the insert command is done.
OBS: I'm not using object oriented PHP. Should I use for this porpose? (If so, is it a problem use both OO and procedural php in the same page?)
If you need more information to be able to help me or I wasn't clear enough, please let me know. Thanks in advance!
</div>