는 HTML 업로드 양식 :XAMPP에 이미지를 저장하고 웹 PHP에서 보여
<form action="InformationData.php" method="post" enctype="multipart/form-data">
<label >Barangay Certification</label>
<input name="BarangayCertification" type="file" id="exampleInputFile1">
<button type="Submit" name="Submit" value="Upload">Submit</button>
</form>
InformationData.php
:
<?php
$conn = mysqli_connect("localhost", "root", "", "registration");
$informations = "SELECT * FROM stakeholderinformations";
$result = $conn->query($informations);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
$BarangayCertification = $row['BarangayCertification'];
echo $BarangayCertification;
}
}
?>
내가 시도 : 이미지를 보여
<?php
$conn = mysqli_connect("localhost", "root", "", "registration");
if($_POST['BarangayCertification']){
$BarangayCertification = $_POST['BarangayCertification'];
} else {
$BarangayCertification = "";
}
$sql = "INSERT INTO stakeholdersform (BarangayCertification) VALUES ($BarangayCertification);
?>
코드 그것을 반향하지만 아무 일도 일어나지 않지만 데이터베이스에서 이미지를 볼 수 있습니다.
질문의 상태는 무엇입니까? –