Insert date into database
I can't seem to understand how to store date into mysql table.
I use data type:date into this field of the table.
First of all I want to store today's date.
In my PHP I create a var $date = date("Y-n-j"); I store this var and I get 0000-00-00. I also tried with now() inside my query but still get the same result.
Can anyone explain to me the way we store dates?
Ok. I realized I was making a terrible mistake somewhere else in my code.
The variable works fine.
Sorry if I spent your time with this.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)