Gossamer Forum
Skip to Content



Home : General : Databases and SQL :

GT mode with mysql now()

Quote Reply
GT mode with mysql now()
   



HI guys
i am back


i try to insert a date into a table but it fails.
Could someone here could kindly point me out the problem?

date => "now()" is not a correct syntax?

my ($sth,$tab,$output);
$tab = $DB->table('table');

$tab->insert(
{

column1 => 'abc' ,
date => "now()"
} )

$error = $GT::SQL::error;


Thanks in advance

Last edited by:

courierbb: Jul 18, 2009, 2:50 AM
Quote Reply
Re: [courierbb] GT mode with mysql now() In reply to
Try:

date => \"now()"

you have to escape the quotes - otherwise GT::SQL will process it like:

"NOW()" , instead of NOW()

:)

Cheers

Andy (mod)
andy@ultranerds.com



Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
Quote Reply
Re: [Andy] GT mode with mysql now() In reply to
thanks again andy.

it works ..... thank you very muchSmile