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!
Hello all,
I have a date field in mysql db which is inserted manualy by the user.
This field is optinal in the insert form.
the problem is if the user fills up the form without that field (i.e. the variable that holds the value is null! ) the value inserted to the db is not null but 0000-00-00.
how can i prevent that and just insert a null value...?
I have tried checking the date variable before the insert and turned it into null if it wasn't a real date but still the value inserted was 0000-00-00