Images are not getting saved in the specified path. But it is showing in the table.
<?php
include("dbconfig.php");
$date=$_POST['date'];
$type=$_POST['type'];
$name=$_POST['fname'];
$filename=md5(time()).$_FILES['photo']['name'];
$tmpname=$_FILES['photo']['tmp_name'];
move_uploaded_file($tmpname,"myphoto/".$filename);
$sql="insert into eventmay2022(date,type,fname,photo)
values('$date','$type','$name','$filename')";
mysqli_query($conn,$sql);
header("location:index.php");
?>
<tr><td class="user-entry">Upload your photo</td><td class="user-entry"><input type="file" name="photo" value="file"></td></tr>
<tr><td></td><td class="user-entry"><button id="submit" type="submit">Submit</button><button onclick="event.preventDefault();" id="cancel">Cancel</button></td></tr>
Your valuable support would be greatly appreciated.