|
From: Ian B. <ia...@co...> - 2003-08-01 15:39:08
|
On Fri, 2003-08-01 at 08:18, Dave Poirier wrote:
> I'm trying to create a record in a database with a 'expires' field,
> which records are deleted whenever expires <= NOW(). I seem to have
> difficulty grasping how I can generate a query similar to:
>
> UPDATE records SET expires = NOW() + INTERVAL 30 DAY;
>
> I've tried something like:
>
> Records.expires = func.NOW('INTERVAL 30 DAY')
> Records.expires = func.NOW() + 'INTERVAL 30 DAY'
> Records.expires = func.NOW() + '+ INTERVAL 30 DAY'
> Records.expires = func.DATE_ADD(func.NOW(),'INTERVAL 30 DAY')
func.NOW() + const('INTERVAL 30 DAY')
> as well as many other combinations, but none of them seemed to work.
>
> Any suggestion?
> -Dave.
>
> btw, how does one access the raw database connection from a SQLObject? I
> know I somehow have to go thru _connection and then something else, but
> everytime I've tried using _runWithConnection or something similar I
> always end up with an error of some kind.
You might use query, queryAll, or queryOne with your _connection object.
Ian
|