shane85 Posted April 1, 2010 Share Posted April 1, 2010 hey guys I have a form that when submitted, I have 2 drop downs, and 1 text field the 2 drop downs are contacted_month contacted_day and the text field is contacted_year then I submit all this info to my database, however I store it into 1 field called last_contacted now im making a page so "edit client info", but am having a hard time figuring out how to edit this since I have the drop downs and text field and am trying to put a value in it which would be the date, but I need to seperate it into the 3 fields. I know I have to do an array of some sort, but how would it look? Also, would you recomend storing it as a timestamp in the database, an int, or just varChar??? sorry for the newbie question...still learning but appreciate all the help. Quote Link to comment https://forums.phpfreaks.com/topic/197288-date-helppulling-info-from-db-and-seperating-into-3-fields/ Share on other sites More sharing options...
jcbones Posted April 1, 2010 Share Posted April 1, 2010 How is it stored? //data stored m-d-y; $date = explode('-',$db_data); $date[0] = m; $date[1] = d; $date[2] = y; Quote Link to comment https://forums.phpfreaks.com/topic/197288-date-helppulling-info-from-db-and-seperating-into-3-fields/#findComment-1035562 Share on other sites More sharing options...
shane85 Posted April 2, 2010 Author Share Posted April 2, 2010 thanks alot. Solved! This board is extremely helpful. Quote Link to comment https://forums.phpfreaks.com/topic/197288-date-helppulling-info-from-db-and-seperating-into-3-fields/#findComment-1035613 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.