0

I have table named timetable which consists Day in it. The data that enter are randomly such as monday friday tuesday and so on. Therefore i want to pull out to php in order starting from monday tuesday and so on.

 ORDER BY FIELD(<fieldname>, 'MONDAY', 'TUESDAY', 'WEDNESDAY', 'THURSDAY', 'FRIDAY', 'SATURDAY', 'SUNDAY');

i found out code above is used to solve the problem of mine. But somehow i didn't understand how to use it and what its mean by FIELD and fieldname.

is it suppose to be write like this?

   SELECT * FROM timetable WHERE NoStudent = '".$NoStudent."' Order By Day ('Monday', .......);

please help me. Thank you

killer boyz
  • 65
  • 1
  • 8

1 Answers1

-1
ORDER BY
     day ASC

use this may be It will help you

Samir Paruthi
  • 121
  • 1
  • 3
  • 12