Php – thesql NOW() + $seconds php

MySQLPHP

Is it possible to use mysqls NOW() function and add seconds to or from it?

Like so;

$q = $dbc -> prepare ("UPDATE account SET time = NOW() + $seconds WHERE id = ?");

Thanks

Best Answer

If you want to do this in MySql, you can either use

DATE_ADD(NOW(), INTERVAL $seconds SECOND)

or

UNIX_TIMESTAMP() + $seconds

Source