我创建了一个表单,它将搜索范围的值发送到数据库,但它似乎不起作用。
查询:
$alpha = $_POST['alpha'];
$sql = "SELECT * FROM tbl_members WHERE resultselect=? AND lname LIKE ?;";
$q = $conn->prepare($sql);
$q->execute(array($categoryid,"[".$alpha."]%"));
表格:
<form action="" method="post">
<button class="btn btn-link" value="abc" name="alpha">A-B-C</button>
<button class="btn btn-link" value="def" name="alpha">D-E-F</button>
</form>