웹 사이트에 데이터 표가 있으며 이름, 유형 및 날짜와 같은 기준에 따라 검색 기능을 추가하고 싶습니다. 이벤트에 대해서. 여기 PHP, mySQL, HTML을 사용하는 웹 사이트의 표 검색 기능
내 표 코드 : I 유형, 날짜, 이름, 텍스트 상자와 드롭 다운 상자를 필요<?php
$user="admin";
$pass="whatever";
$host="localhost";
$db_name="eventregisteration";
$con=mysqli_connect($host, $user, $pass, $db_name);
if(mysqli_connect_errno($con)){
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$sqlget="SELECT * FROM eventform";
$sqldata=mysqli_query($con,$sqlget)
or die("Error Getting Data");
echo "<table border=2 bordercolor=#440000 cellpadding=2 bgcolor=#DDDDDD width=100%>";
echo "<tr bgcolor=#555555 style=font-size:18px><th>Event Code</th><th>Event Name</th><th>Event Type</th><th>Event Level</th><th>Start Date</th>
<th>End Date</th><th>Point</th><th>Picture</th><th>Video</th><th>Description</th></tr>";
while($row=mysqli_fetch_array($sqldata, MYSQLI_ASSOC)){
echo "<tr align=center><td>";
echo $row['event_code'];
echo "</td><td>";
echo $row['event_name'];
echo "</td><td>";
echo $row['event_type'];
echo "</td><td>";
echo $row['event_level'];
echo "</td><td>";
echo $row['start_date'];
echo "</td><td>";
echo $row['end_date'];
echo "</td><td>";
echo $row['points'];
echo "</td><td>";
echo $row['pic'];
echo "</td><td>";
echo $row['video'];
echo "</td><td>";
echo $row['description'];
echo "</td></tr>";
}
echo "</table>";
?>
, 나는 사용자가 원하는 그렇다면 서로 이것들을 연결하는 방법을 모른다 이름으로 검색하면 이름을 선택하고 날짜별로 검색하려면 캘린더가 표시됩니다.
왜이 코드가 필요합니까? 이것은 단지 결과를 표시하기위한 것입니다. – Jenz
실제로 링크를 사용하여 그림과 비디오를 표시해야하지만 그 방법을 모릅니다. 다른 방법을 제안합니까? – Shane
은 데이터베이스에 파일 이름 만 저장하고 있습니까? localhost에서 작업하고 있습니다. 저에게 알려주세요. – Jenz