Menu
Hi.
Im sure Im doing something really stupid. I am trying to insert a date into my mysql database using the following code –
$reg_date=date();
$sql = “Insert into bb_user (username, password, city, recommended_by, status, reg_date) values (‘$username’, ‘$password’, ‘$city’, ‘$recommended_by’, ‘$status’, ‘$reg_date’)”;
$result1 = mysql_query($sql) or die(“Cannot add user!”);
The “reg_date” field is type “date”.
……… but the date shown in the database after entry is 0000-00-00
Does anybody know what Im doing wrong?
Thanks in advance.
Jonty