i have a dependent drop-down list which composition is being populated depending on KNITTYPE. But when i try to order the composition i can not get any result, it doesnt work . what am i doing wrong ?
my second question is : how can i eliminate the repeat of the same composition results i know they belong to different rows but i want to merge them so for eaxmple when i select 100%COTTON i want to bring all 100%COTTON results , rightnow its bringing 100% cotton for each KNITTYPE SELECTED ?
<?php
require_once 'dbconnect.php';
if(!empty($_REQUEST["KNITTYPE_id"])) {
$query ="SELECT COMPOSITION FROM egearge3 WHERE KNITTYPE =" . "'" . mysqli_escape_string($conn, $_POST["KNITTYPE_id"] ) ."' AND ORDER COMPOSITION BY ASC" ;
$result = mysqli_query($conn, $query);
?>
<option value="">Select COMPOSITION</option>
<?php
while($row2=mysqli_fetch_assoc($result)){
//var_dump($row2);
if($bul2[$row2['COMPOSITION']] != true && $row2['COMPOSITION'] != 'COMPOSITION' || 1) { ?>
<option value="<?php echo $row2['COMPOSITION']; ?>"><?php echo $row2['COMPOSITION']; ?> </option>
<?php
$bul2[$row2['COMPOSITION']] = true;
}
}
}
?>