here is a working example I made myself
For the connectiion.php
<?php
$server_name="localhost";
$mysql_username="root";
$mysql_password="";
$db_isim="deneme1";
$conn= mysqli_connect($server_name,$mysql_username,$mysql_password,$db_isim);
$conn->set_charset("utf8");
if ($conn)
{
echo "bağlantı var"."<br>";
}
else
{
echo " bağlantı yok"."<br>";
}
?>
U can change the paraneters
And here is the code for image display
All tested and working
<!DOCTYPE html>
<html lang="en">
<head>
<title>formdan listeleme</title>
</head>
<body>
<form action="ekle1.php" method="post" enctype="multipart/form-data">
<fieldset>
<legend>Araba tablosuna Yeni kayıt ekle</legend>
<label>Marka</label>
<label style="margin-left:50px">Model</label><br>
<select name="markalar">
<option value="marka1">marka1</option>
<option value="marka2">marka2</option>
<option value="marka3">marka3</option>
<option value="marka4">marka4</option>
<option value="marka5">marka5</option>
</select>
<select style="margin-left:25px" name="modeller">
<option value="model1">model1</option>
<option value="model2">model2</option>
<option value="model3">model3</option>
<option value="model4">model4</option>
<option value="model5">model5</option>
</select><br><br>
<label for="Satici">Satici No:</label><br>
<input type="text" id="satici" name="satici"><br><br>
<textarea name="content" rows="10" cols="50">Lütfen satılık araba ile ilgili açıklamayı buraya yazınız</textarea>
<br><br>
<label for="fiyat">Fiyatı:</label><br>
<input type="number" id="fiyat" name="fiyat"><br><br>
<label for="res1">İlk resim:</label><br>
<input type="file" id="res1" name="res1"><br><br>
<label for="res2">İkinci resim:</label><br>
<input type="file" id="res2" name="res2"><br><br>
<label for="vid">Video:</label><br>
<input type="file" id="vid" name="vid"><br><br>
<!-- buraya tarih yerine otomatik tarih alma yap -->
<label for="tarih">Tarih:</label>
<input type="datetime-local" id="tarih" name="tarih"><br><br>
<button type="submit" name="ekle">Kayıt ekle</button>
<input type="reset" style="margin-left:50px">
</fieldset>
</form>
<!--
<form action="/action_page.php">
<input list="browsers">
<datalist id="browsers">
<option value="Internet Explorer">
<option value="Firefox">
<option value="Chrome">
<option value="Opera">
<option value="Safari">
</datalist>
</form>
-->
<?php
require "baglan.php";
$marka=$_POST["markalar"];
echo $marka."<br>";
$model=$_POST["modeller"];
echo $model."<br>";
$satici=$_POST["satici"];
echo $satici."<br>";
$icerik=$_POST["content"];
echo $icerik."<br>";
$fiyat=$_POST["fiyat"];
echo $fiyat."<br>";
$tarih=$_POST["tarih"];
echo $tarih."<br>";
echo "<pre>";
print_r($_FILES);
echo "</pre>";
$isim1 = $_FILES['res1']['name'];
$isim2 = $_FILES['res2']['name'];
$isim3 = $_FILES['vid']['name'];
$hedef_dizin="";
$hedef_dosya1= $hedef_dizin . basename($isim1);
$hedef_dosya2= $hedef_dizin . basename($isim2);
$hedef_dosya3= $hedef_dizin . basename($isim3);
//bu sayfa bir veritabanına veri eklemektedir.
$sorgu= "INSERT INTO `araclar` (`Marka`, `Model`, `Satan`, `Content`, `Fiyat`, `Res1`, `Res2`, `Vide`, `Tarih`) VALUES ('ford', 'focus', '2', 'bu da başka bir araba', '55000','".$isim1."', '".$isim2."','".$isim3."', '2020-10-21 18:12:000');";
$sonuc= mysqli_query($conn,$sorgu);
move_uploaded_file($_FILES['res1']['tmp_name'],$hedef_dizin.$hedef_dosya1);
move_uploaded_file($_FILES['res2']['tmp_name'],$hedef_dizin.$hedef_dosya2);
move_uploaded_file($_FILES['vid']['tmp_name'],$hedef_dizin.$hedef_dosya3);
$sql = "select res1, res2, vide from araclar where id=$conn->insert_id;";
$sonuc = mysqli_query($conn,$sql);
$row = mysqli_fetch_array($sonuc);
echo "<pre>";
print_r($row);
echo "</pre>";
$image1 = $row['res1'];
$image_src1 = " ".$image1;
$image2 = $row['res2'];
$image_src2 = " ".$image2;
$image3 = $row['vide'];
$image_src3 = " ".$image3;
?>
<img src='<?php echo $image_src1; ?>' ><br><br>
<img src='<?php echo $image_src2; ?>' ><br><br>
<img src='<?php echo $image_src3; ?>' ><br><br>
<?php
echo "kayıt eklendi" ;
//$sonuc->free();
?>
</body>
</html>
I made this as an example in a class so sorry for the fast and lame coding
If you paste this code to an editor starting from first line
lines 10-50 are for a form to give values for the new record
What you are looking for starts from line 108
there are 3 fields with the names res1 res 2 and vide
Print_r lines are for students to show them what is actualy inside the arrays
and lines 116 to 125 displays the pictures
any further questions are wellcome