Re: HOW update time and date-fields to mysql....

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2/28/06, Gustav Wiberg <gustav@xxxxxxxxxxxxxx> wrote:
>
> Hi there guys!
>
> I have used a date-field and a time-field in a mysql-database.
>
>
>
>
> $sql = "UPDATE tbforum SET";
> $sql .= " question=" . safeQuote($frmQuestion);
> $sql .= ", insertDate='" . $dat . "'";
> $sql .= ", insertTime='" . time() . "'";
> $sql .= " WHERE IDForum=" . safeQuote($idForum);
> $querys = mysql_query($sql);



Use NOW() for both your date and time fields if the fields have been set up
as that. MySQL will then add the date and time according to whatever those
values are on your db machine.

Cheers
Matt

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux