tpstudent Posted September 6, 2008 Share Posted September 6, 2008 Hi i displayed a list of the lecture's class schedule on the datagrid as shown, as you can see, it is currently displaying in Mon, Thu,Tue, Wed. How do i actually sort the days in ascending order like, monday, tuesday, wednesday...? the php coding that retrieve the data SELECT * FROM timetable WHERE staffid = '$staffid'; Link to comment https://forums.phpfreaks.com/topic/123028-how-to-order-by-day/ Share on other sites More sharing options...
elflacodepr Posted September 6, 2008 Share Posted September 6, 2008 add to your query this SELECT * FROM timetable WHERE staffid = '$staffid' ORDER BY day ASC Link to comment https://forums.phpfreaks.com/topic/123028-how-to-order-by-day/#findComment-635255 Share on other sites More sharing options...
dezkit Posted September 6, 2008 Share Posted September 6, 2008 wow, thats a pretty layout, can you pm me it please Link to comment https://forums.phpfreaks.com/topic/123028-how-to-order-by-day/#findComment-635257 Share on other sites More sharing options...
tpstudent Posted September 6, 2008 Author Share Posted September 6, 2008 Hi, SELECT * FROM timetable WHERE staffid = '$staffid' ORDER BY day ASC I try the above codes it come out the same result. Is it because the data type is in string; that is why? What should i do? Link to comment https://forums.phpfreaks.com/topic/123028-how-to-order-by-day/#findComment-635269 Share on other sites More sharing options...
Mchl Posted September 6, 2008 Share Posted September 6, 2008 If you store days as strings, then that's the reason. Store them as number in a week. Link to comment https://forums.phpfreaks.com/topic/123028-how-to-order-by-day/#findComment-635275 Share on other sites More sharing options...
PFMaBiSmAd Posted September 6, 2008 Share Posted September 6, 2008 This might help - http://www.eklekt.com/tutorials/mysql Link to comment https://forums.phpfreaks.com/topic/123028-how-to-order-by-day/#findComment-635278 Share on other sites More sharing options...
tpstudent Posted September 6, 2008 Author Share Posted September 6, 2008 Hi, That link works! Thanks for the help! Link to comment https://forums.phpfreaks.com/topic/123028-how-to-order-by-day/#findComment-635287 Share on other sites More sharing options...
Mchl Posted September 6, 2008 Share Posted September 6, 2008 This might help - http://www.eklekt.com/tutorials/mysql Nice one! Link to comment https://forums.phpfreaks.com/topic/123028-how-to-order-by-day/#findComment-635295 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.