[eluser]vokic[/eluser]
Hi.. You can mod the DB_driver.php in order to allow SQL statements in active record with something like this:
Code:
function escape($str)
{
switch (gettype($str))
{
case 'string' :
if (preg_match("/^SQL_(.+)/", $str, $matches))
$str = $this->escape_str($matches[1]);
else $str = "'".$this->escape_str($str)."'";
break;
case 'boolean' : $str = ($str === FALSE) ? 0 : 1;
break;
default : $str = ($str === NULL) ? 'NULL' : $str;
break;
}
return $str;
}
so you can use it like this:
Code:
$data['date'] = 'SQL_NOW()';
or
Code:
$data['date'] = 'SQL_UNIX_TIMESTAMP()';
and you can use MySQL time in queries so there is no time difference...