You are here: Re: Quick and simple way to order a set of meetings by day of week « PHP Programming Language « IT news, forums, messages
Re: Quick and simple way to order a set of meetings by day of week

Posted by John Meyer on 12/20/05 22:38

Mara Guida wrote:
> John Meyer wrote:
>
>>Okay, I have a database listing various meetings. The meetings have a
>>day of the week and a time (Say Sunday at 8:00). Now, given a set of
>>these meetings, how would I order them so that they would go Sunday,
>>Monday, Tuesday, Wednesday, Thursday, Friday. note these meetings don't
>>have dates, just day of week and time. Oh, and they're coming from a
>>MySQL database.
>
>
>
> create table daysofweek (weekdaynumber int, weekdayname varchar(9));
> insert daysofweek values (0, 'Monday');
> insert daysofweek values (1, 'Tuesday');
> insert daysofweek values (2, 'Wednesday');
> insert daysofweek values (3, 'Thursday');
> insert daysofweek values (4, 'Friday');
> insert daysofweek values (5, 'Saturday');
> insert daysofweek values (6, 'Sunday');
>
> Now link your tables together with daysofweek and ORDER BY
> weekdaynumber.

Thanks for pointing out an obvious and simple solution.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация