The easiest way is to create a timestamp field (see manual depending on how
you want to store the date, as you can go from yyyy to ddmmyyyyhhmmss...),
and when you create your DB update query, use now().

for example, update a field with a new email address, and the user's current
ip with the time of the update where his user id number is 123456789.

UPDATE mail_address SET
email = '$email',
timesent = now(),
ip = '$ip'
WHERE
user_id = 123456789;

now() will set the value of the field timesent to the current time of the
mysql server.

Cheers,
Daniel

"Zenith" <[EMAIL PROTECTED]> a écrit dans le message news:
97jep3$sgu$[EMAIL PROTECTED]
> How can I insert time and date into mysql table,
> if the table i have to insert has a field of type time, and a field of
type
> date.
>
> Then how can I insert it in PHP, if I use time() function??
>
>



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to