image upload in php code example
Example: how to upload image in php and store in database and folder
// Get the name of images
$Get_image_name = $_FILES['image']['name'];
// image Path
$image_Path = "images/".basename($Get_image_name);
$sql = "INSERT INTO student_table (imagename, contact) VALUES ('$Get_image_name', 'USA')";
// Run SQL query
mysqli_query($conn, $sql);
if (move_uploaded_file($_FILES['image']['tmp_name'], $image_Path)) {
echo "Your Image uploaded successfully";
}else{
echo "Not Insert Image";
}
}