I need to put first selected item in a list, and then the rest in order by id.
My table:
id:1 car: fiat
id:2 car:ford
id:3 car:vw
id:4 car:toyota
the problem in .com/index.php?car=fiat
$car = $_GET['car'];
$results = mysqli_query($connecDB,"select * from products order by (case id when 999 then 0 else 1 end), car asc");
and the body
while($row = mysqli_fetch_array($results )){
echo '
<div id="'.$row["car"].'"></div>
';
}
In example:
if I get the value 3:
ID
3
1
2
4
5
if I get the value 4:
ID
4
1
2
3
5
I dont know where to put the variable $car to work properly.
Thanks and i apoligize for my english.