I use this query but I don't know how will I order this by DoctorName?
$q=mysqli_query($link,"Select * from doctor where status='". $stat ."'");
I use this query but I don't know how will I order this by DoctorName?
$q=mysqli_query($link,"Select * from doctor where status='". $stat ."'");
Add an ORDER BY statement to your query:
$q=mysqli_query($link,"Select * from doctor where status='". $stat ."' ORDER BY `doctor_last_name`");
Use the ORDER BY command to order by columns.
$q=mysqli_query($link,"Select * from doctor where status='". $stat ."' ORDER BY doctor_last_name");
You can add a list to the ORDER BY command to provide a hierarchy of order. Example:
SELECT * FROM EmployeeData ORDER BY Date, LastName, FirstName;
This command will sort by the Date column first. All matching dates will then be ordered by the LastName column. All possible records that Date AND LastName match will be ordered by the FirstName column and so on!