champoi Posted November 20, 2008 Share Posted November 20, 2008 i store in my php a date where in the syntax goes like this: 0000-00-00 (y-m-d) im doing a program that edits the current date, but i want the values in the drop down box to be default to what the user first inputed the values, the problem is that i have multiple drop down boxes that makes up the 0000-00-00, one for year, one for month and another for day, i dont know how to divide the 0000-00-00 in order to let each drop down know what value it will show, anyone knows how? Quote Link to comment https://forums.phpfreaks.com/topic/133468-solved-dividing-mysql-values-in-php/ Share on other sites More sharing options...
vbnullchar Posted November 20, 2008 Share Posted November 20, 2008 <?php $stamp = strtotime('0000-00-00'); $day = date('d', $stamp); $month = date('m', $stamp); $year = date('Y', $stamp); ?> Quote Link to comment https://forums.phpfreaks.com/topic/133468-solved-dividing-mysql-values-in-php/#findComment-694183 Share on other sites More sharing options...
Mchl Posted November 20, 2008 Share Posted November 20, 2008 Get some datapicker widget, so that you can choose date easier. See this one for example http://www.frequency-decoder.com/2006/10/02/unobtrusive-date-picker-widgit-update Quote Link to comment https://forums.phpfreaks.com/topic/133468-solved-dividing-mysql-values-in-php/#findComment-694191 Share on other sites More sharing options...
champoi Posted November 20, 2008 Author Share Posted November 20, 2008 thnx Quote Link to comment https://forums.phpfreaks.com/topic/133468-solved-dividing-mysql-values-in-php/#findComment-694346 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.