我想从复选框中获取条件以按年龄过滤客户。当我选中此复选框时,所有客户的年龄都将超过该年龄范围。
我不知道如何通过这些复选框在表格上显示结果。
我的PHP复选框:
<div class="list-group">
<h3>Age</h3>
<?php
$query = "SELECT CONCAT((FLOOR(age/10))*10,' - ',((FLOOR(age/10))*10)+10) as age_range FROM customerinfo GROUP BY age_range ORDER BY age_range ASC";
$statement = $connect->prepare($query);
$statement->execute();
$result = $statement->fetchAll();
foreach($result as $row)
{
?>
<div class="list-group-item checkbox">
<label><input type="checkbox" class="common_selector age" value="<?php echo $row['age_range']; ?>" > <?php echo $row['age_range']; ?></label>
</div>
<?php
}
?>
</div>
截屏: