I have the following if statement. I want to sort by a variable called $slippercent
variable if $slippercent
is between 2.5 and 4 show in top and the rest next.
Let say i have the following records:
record A = `$slippercent`=1
record B = `$slippercent`=2.6
record C = `$slippercent`=2.5
record D = `$slippercent`=2.0
record E = `$slippercent`=5
record F = `$slippercent`=4
record G = `$slippercent`=2.8
record H = `$slippercent`=3
I want to show as follows
record C
record B
record G
record H
record F
the rest orders dont matter
$record = mysqli_query($con,"SELECT * FROM tbl ORDER BY (Tread_Design='$rtdesign') DESC, (Manufacturer='$rbrand') DESC,Brand_Name");
while ($row = mysqli_fetch_array($record)) {
if (preg_match("/\b".preg_quote($txtbrand)."\b/i", $row['Brand_Name']) && ($row['OD']>=$small && $row['OD']<=$large) && ($txtbrand != "" && $row['OD'] != "" && $row['Brand_Name']!="") )
{
$frontrc= $row['RC'];
$slippercent = round(((($frontrc*$it2t1)/$rearrc)-1)*100,2);
$slippercent2 = round(((($frontrc*$it2t1)/$rearrc)-1)*2000, 2);
echo "<td style='width:60px; text-align:left; vertical-align: middle;'>";echo $row['SW'];"</td>";
echo "<td style='width:60px; text-align:left;vertical-align: middle;'>";echo $row['OD'];"</td>";
echo "<td id='slippercent' style='width:80px; text-align:center;'><center>";echo$slippercent;echo'%';"</center></td>";
}
I want to sort or Order if $slippercent
is between 2.5 and 4 to show on top any order after