I have a form from there user enters the data, it pass the values the IP address, and DateTime. It is passing all the variables but the datetime to the database. Strange thing is that it is working fine for the emails, not for database. Please give me any solutions.
Post the code that generates the date that you're inserting into MySQL. It should be in the format YYYY-MM-DD HH-MM-SS (or any other delimiters you want to use to divide it up).
Gil
HI Gil
The codes I'm using is:
$datetime= date(" Y-d-m h:i:s");
It is working for the e-amil not for the database.
Thankyou
Take the space out of the beginning of the date function. So that'll make it
$datetime= date("Y-d-m h:i:s");
If that doesn't work, then change the : to -, although that probably won't fix it either.
I got this to work. I need to use the NOW() function in order to pass the date to the database.
Just a slight change in the format should fix the problem:
$datetime = date('Y-m-d H:i:s');
Bojan