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 am currently facing problem with date in php , whenever there is empty date field to be put in the mysql database, it automatically captures the timestamp as 943900200 when formatted it becomes '30-11-1999' which is wrong date.
facing this problem everywhere in application.
cant find the solution for this one,
currently handling this error by hard coding the above timestamp...
please suggest a solution for this one...
jiturc889 wrote:whenever there is empty date field to be put in the mysql database, it automatically captures the timestamp as 943900200 when formatted it becomes '30-11-1999' which is wrong date.
whatever date i select in my form, is get inserted into data base correctly, but when i dont select any date, that means it should be a blank field in data base, but insted it gets above timestamp automatically
jiturc889 wrote:whatever date i select in my form, is get inserted into data base correctly, but when i dont select any date, that means it should be a blank field in data base, but insted it gets above timestamp automatically
Unless the field in your database is set to "NOT NULL" meaning that it cannot be blank? It might then be inserting a default value which is the value you mentioned above.