PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I have a text box which stores a date from a table I have in MySQL. I want the user to be able to change the date if they would like which works fine, the problem I'm having is I have to display the date in the text box as dd-mmm-yyyy. If the user updates another field and leaves the date as that format MySQL doesn't recognize the date so it changes the date to NULL. I tried the Date() function but it changes the date to 1969-12-31. How can I change the format of the text box to be MySQL's format before the database is updated? Here is the code I currently have.
it's easier to actually have 3 inputs, one for month, day, and year. Each can be a textbox, but it's often easier to have drop-downs for at least month and day. Although the validation routine remains the same for all.
Thanks Tim but I'm not outputting the data I'm trying to update the data in the database. I currently use date_format for outputting but does it work the same way when updating the database?