Upload image file in a directory when submit data into database use move_uploaded_file() in php. When you insert record into database then set a directory path in the move_uploaded_file() and and call the file value. For example:
<?php if(isset($_POST['submit'])){ move_uploaded_file($_FILES["upload_file"]["tmp_name"],"uploads/" . $_FILES["upload_file"]["name"]); $sql=mysqli_query($con,"INSERT INTO `Table Name`( `field1`, `field2`, `field3`)VALUES('$variable1','$variable2','$variable3')"); } ?>
Question and answer is powered by AnsPress.io