我有一个表单,它使用post方法将一个Roll_No值发送到一个php文件:
//Query the database
$resultSet = $mysqli->query("SELECT * FROM late WHERE 'Roll_No' LIKE '" . $_POST['Roll_No'] . "';");
//Count the returned rows
if($resultSet->num_rows != 0){
//Turn the results into an array and echo them
while($rows = $resultSet->fetch_assoc())
{
$Roll_No = $rows['Roll_No'];
$Time = $rows['Time'];
echo "<p>Roll_No: $Roll_No <br />Time: $Time</p>";
}
我的代码似乎无法从表单中获取Roll_No值,因此没有给出任何结果。
编辑:这是表格
<form action="report-d1.php" method="post" />
<p>Search by Roll_No<input type="text" name="Roll_No" /></p>
<input type="submit" value="Submit" />
</form>