| Author |
current date-time in php
|
|
| vishal 2005-03-29, 3:57 pm |
| i want to store the date and time when the user registered i.e. the
record is entered in my table.
so how can i achieve this????
should i use php or mysql to achieve this??
which is more proper and how can i get date-time ???
thxs
| |
| frizzle 2005-03-29, 3:57 pm |
| Both ways are proper, you could use http://nl2.php.net/date as a php
function, and insert that into the DB, or use the handy mySQL
filed-type:
TIMESTAMP which automatically picks the current date/time when a record
is created...
| |
| Jean-Baptiste Nizet 2005-03-29, 3:57 pm |
| AFAIK, the MySQL timestamp values are also automatically updated when
the database row is modified, which doesn't seem to be what the OP
asked for. I would use a DATETIME field, and the MySQL function NOW().
JB.
| |
| boclair 2005-03-29, 3:57 pm |
| vishal wrote:
> i want to store the date and time when the user registered i.e. the
> record is entered in my table.
>
> so how can i achieve this????
>
> should i use php or mysql to achieve this??
>
> which is more proper and how can i get date-time ???
>
perhaps date("U")?
Louise
|
|
|
|