austine_power007 Posted December 10, 2006 Share Posted December 10, 2006 I want to retrieve date from access and i think its in mm/dd/yy format so how can i divide each of the separately i want part by part dd then mm then yy then i will show in 3 different text field.......i think someone is ready to ans me :) Link to comment https://forums.phpfreaks.com/topic/30095-how-to-divide-whole-date-into-part/ Share on other sites More sharing options...
fert Posted December 10, 2006 Share Posted December 10, 2006 [code]$date=explode("-",$date);echo "<input type=\"text\" name=\"name\" value=\"{$date[0]}\"><input type=\"text\" name=\"name\" value=\"{$date[1]}\"><input type=\"text\" name=\"name\" value=\"{$date[2]}\">";[/code] Link to comment https://forums.phpfreaks.com/topic/30095-how-to-divide-whole-date-into-part/#findComment-138361 Share on other sites More sharing options...
alpine Posted December 10, 2006 Share Posted December 10, 2006 [quote author=fert link=topic=118037.msg482002#msg482002 date=1165730764][code]$date=explode("-",$date);[/code][/quote]Exept that the correct one in this case is explode("/",$date);You can also look into substr() Link to comment https://forums.phpfreaks.com/topic/30095-how-to-divide-whole-date-into-part/#findComment-138363 Share on other sites More sharing options...
fert Posted December 10, 2006 Share Posted December 10, 2006 well if it's not stored as a DATE in a mysql database. Link to comment https://forums.phpfreaks.com/topic/30095-how-to-divide-whole-date-into-part/#findComment-138365 Share on other sites More sharing options...
alpine Posted December 10, 2006 Share Posted December 10, 2006 :) That's true fert - i just try to base the solution on what was presented by the topic starter, hence the quote. Link to comment https://forums.phpfreaks.com/topic/30095-how-to-divide-whole-date-into-part/#findComment-138369 Share on other sites More sharing options...
austine_power007 Posted December 10, 2006 Author Share Posted December 10, 2006 Well i mentioned ACCESS mean i am using Microsoft Access 2003 database is this code works with that ?? Link to comment https://forums.phpfreaks.com/topic/30095-how-to-divide-whole-date-into-part/#findComment-138409 Share on other sites More sharing options...
alpine Posted December 10, 2006 Share Posted December 10, 2006 explode() is a php function and will handle whatever you have fetched from your db Link to comment https://forums.phpfreaks.com/topic/30095-how-to-divide-whole-date-into-part/#findComment-138531 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.