Topic: date n time

I know that my question may sound stupid, but I'll ask anyway...

$username = $_POST['username'];
$email = $_POST['email'];
$password = md5($_POST['password']);
$password2 = md5($_POST['password2']);
$location = $_POST['location'];
$genre = $_POST['genre'];
$date =

what should I write to insert date and time in the database and what type should I specify on the database side?

thanks a lot smile

Thumbs up

Re: date n time

mysql_query("INSERT INTO info set info.username = $user, info.email = $email...info.created = NOW()");

I usually do something like that. I don't save the time to any variable like you are suggesting. I just fill it on the query. Type of the column is Datetime.

Thumbs up

Re: date n time

You can use the NOW() function of mysql, and set the field data type as DATETIME

Thumbs up