When sorting, I have sorted, starting with the first digits, that is 1, 11, 12, 13, 2, 21, 22, but it is necessary that 1, 2, 3, 4 ... 11, 12, etc. Here is my request:
$myCmd = "SELECT * FROM dlpodrazdeleniya, dldoctor, dlSpec, dltime WHERE id='$cat' AND dldoctor.idPodr = dlpodrazdeleniya.idPodr AND dldoctor.SpecID = dlSpec.SpecID AND dldoctor.DoctorID = dltime.DoctorID ORDER BY dltime.Ychastok, dltime.DoctorID";
I sort at first by plots, then by doctors, but, more importantly, the plots are sorted, as I described above.