Gossamer Forum
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.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] GT mode with mysql now() In reply to
thanks again andy.

it works ..... thank you very muchSmile