Is there any way to order a database by a specific name stored in a function then random?
For example, if $name = 'Hasan' then I want the query to select Hasan row first then the other rows randomly
<?php
/* DATA BASE
id | Name
--------------+--------------------------------
'1' | Hasan
'2' | Ahmad
'3' | Majid
'4' | Hazem
*/
if(isset($_GET['name'])) {
$name = $_GET['name'];
}
else {
$name = 0;
}
$query = mysqli_query($con, "SELECT * FROM database ORDER BY $name, rand()");
?>