in reply to Placeholders and NOW()
yes:
But I suspect NOW() is a function in your particular database, in which case you wouldn't use a placeholder, and you would just put a literal NOW() in your SQL statement.sub NOW { # Return current time in whatever format it # Needs to be in } $sth->execute(NOW());
Example:
my $sth = $dbh->prepare(q{ INSERT INTO t ( foo, bar, time ) VALUES (?, ?, NOW() ) }); $sth->execute($foo, $bar);
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Answer: Placeholders and NOW()
by dws (Chancellor) on Aug 15, 2002 at 02:48 UTC |
In Section
Seekers of Perl Wisdom