|
Posted by Jason Wong on 01/16/05 15:29
On Sunday 16 January 2005 15:22, Michael Gale wrote:
Not a direct answer to your problem ...
> $query="INSERT INTO tentry_table SET ticket_id = '" . $ticket . "',";
> $query .= " tentry_date = '" . date("Y-m-d") . "',";
> $query .= " tentry_time = '" . date("H:j:s") . "',";
1) When doing something involving date/time it is best practice to assign
date/time *once* to a variable then work off of that variable. This ensures
that your date/time is consistent withing that block of code.
2) If there is no particular reason why you are storing the date and the time
separately why not just use a DATETIME field? Then you can just use the
builtin db function NOW(). Or, if that datetime never changes once assigned,
you could even use a TIMESTAMP field.
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
New Year Resolution: Ignore top posted posts
Navigation:
[Reply to this message]
|