RE: [PHP] simple date() question
| From: | Lazor, Ed | Date: | Mon, 17 Jun 2002 17:17:40 +0000 |
| Subject: | RE: [PHP] simple date() question | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-102548@lists.php.net to get a copy of this message | ||
You can have MySQL do this for you using the now() function.
insert into tablename (field1, field2) values (now(), $name)
> -----Original Message-----
> I want to get the current date & time and insert it into
> MySQL so it can
> be sorted later.
>
> Anyone have some code for this?
>
> $date_time = getdate();
> ...then is this variable ready to be put into MySQL with type DATETIME
> ?? Or do I have to change this variable around a bit?
>
> Thans!!
>
****************************************************************************
This message is intended for the sole use of the individual and entity to
whom it is addressed, and may contain information that is privileged,
confidential and exempt from disclosure under applicable law. If you are
not the intended addressee, nor authorized to receive for the intended
addressee, you are hereby notified that you may not use, copy, disclose or
distribute to anyone the message or any information contained in the
message. If you have received this message in error, please immediately
advise the sender by reply email and delete the message. Thank you very
much.