Below is my code and I want upload image in a specific row so I want to use where keyword in SQL query but when I use where keyword in SQL query in below code it doesn't work.
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$image = $_FILES['imageup']['tmp_name'];
$img = file_get_contents($image);
$con = mysqli_connect('localhost', 'aish', 'aish123', 'photo') or die('Unable To connect');
$sql = "insert into image (img) values(?)";
$stmt = mysqli_prepare($con, $sql);
mysqli_stmt_bind_param($stmt, "s", $img);
mysqli_stmt_execute($stmt);
$check = mysqli_stmt_affected_rows($stmt);
if ($check == 1) {
$msg = 'Successfullly UPloaded';
} else {
$msg = 'Could not upload';
}
mysqli_close($con);
}