abazoskib Posted June 30, 2009 Share Posted June 30, 2009 what would be the most efficient way to store days of the week? im using them to trigger notification events in an alarm type application. i was thinking i could store a value 0 or 1 for each day of the week, but I don't know how efficient that would be. Quote Link to comment https://forums.phpfreaks.com/topic/164252-storing-days-of-the-week/ Share on other sites More sharing options...
Hybride Posted June 30, 2009 Share Posted June 30, 2009 If this is MySQL, I think Date format or the general MySQL Date and Time functions should help you. Quote Link to comment https://forums.phpfreaks.com/topic/164252-storing-days-of-the-week/#findComment-866475 Share on other sites More sharing options...
fenway Posted June 30, 2009 Share Posted June 30, 2009 That's not near enough info to help. Quote Link to comment https://forums.phpfreaks.com/topic/164252-storing-days-of-the-week/#findComment-866671 Share on other sites More sharing options...
abazoskib Posted June 30, 2009 Author Share Posted June 30, 2009 sorry guys, didn't mean to do this the wrong way. excuse me for my mistake. here i go again: mySQL version 5.0.45 What I would like to do is have an event alarm clock. I want the user to be able to check the checkboxes for any days of the week they would like the alarm to show up, input their alert message, and then to enter the time of the alert. What would be the most efficient way to store which days they checkmarked? Like I said I was thinking I could store a 1 for each day of the week that is selected, and 0 for it being not selected. Of course this would mean I have a column in my table for each day of the week. Can anyone think of a better way to store the values? hopefully that was a better explanation. thanks for the tip fenway. Quote Link to comment https://forums.phpfreaks.com/topic/164252-storing-days-of-the-week/#findComment-866725 Share on other sites More sharing options...
fenway Posted July 1, 2009 Share Posted July 1, 2009 That's basically a SET column type -- not impossible to work with, but just a bit more complicated to update. Quote Link to comment https://forums.phpfreaks.com/topic/164252-storing-days-of-the-week/#findComment-867163 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.