我想列出所选的选项。但是有3个单独的选择框。 “品牌”,“燃料”和“齿轮”。例如,当我选择福特品牌时,它被列出但如果我选择带有品牌的燃料和装备,我会得到一个错误的清单。怎么会这样?
数据库含义
TABLE(araclar =“CARS TABLE”)arac_marka =“BRANDS”arac_vites =“GEAR”arac_benzin =“FUEL”
AND FORM ACTION(SELF)
<form action="" method="get">
<div class="col-xs-12 col-sm-3 col-md-3">
<select name="arac_marka" class="form-control">
<option value="">Marka Seçin</option>
<? $marsor=$db->prepare('SELECT * FROM araclar');
$marsor->execute();
while ($marcek=$marsor->fetch(PDO::FETCH_ASSOC)){ ?>
<option value="<?=$marcek['arac_marka'];?>">
<?=$marcek['arac_marka'];?>
</option>
<? } ?>
</select>
</div>
<div class="col-xs-12 col-sm-3 col-md-3">
<select name="arac_benzin" class="form-control">
<option value="">Yakıt Tipi</option>
<option value="Benzin">Benzin</option>
<option value="Dizel">Dizel</option>
<option value="Hybrid">Hybrid</option>
<option value="LPG">LPG</option>
</select>
</div>
<div class="col-xs-12 col-sm-3 col-md-3">
<select name="arac_vites" class="form-control">
<option value="">Vites</option>
<option value="Benzin">Otomatik</option>
<option value="Dizel">Manuel</option>
<option value="Hybrid">Yarı Otomatik</option>
</select>
</div>
<div class="col-xs-12 col-sm-2 col-md-3 col-lg-2">
<input class="btn btn-primary" type="submit" name="dtara" value="Filtrele">
</div>
<div class="col-xs-12 col-sm-2 col-md-3 col-lg-2">
<a href="araclarimiz" class="btn btn-raised">Tüm Araçlar</a>
</div>
</form>
AND LISTING
<? if(isset($_GET['dtara'])) {
$marka=$_GET['arac_marka'];
$benzin=$_GET['arac_benzin'];
$vites=$_GET['arac_vites'];
$asql=$db->prepare("SELECT * FROM araclar
WHERE arac_marka='$marka'
OR arac_benzin='$benzin'
OR arac_vites='$vites'");
$asql->execute();
} else {
$asql=$db->prepare('select * from araclar');
$asql->execute();
}
while ($acek=$asql->fetch(PDO::FETCH_ASSOC)){?>
//Listing Here
<? } ?>