Leser: 1
6 Einträge, 1 Seite |
adddate(now(), interval 1 year)
1 2 3
my $query = 'INSERT INTO datum (bestelldatum, expire) VALUES( ?, ?)'; my @query_data = ('now()', 'adddate(now(), interval 1 year)'); $dbh->do($query, \%attr, @query_data);
1 2 3 4 5 6 7 8 9 10
mysql> insert into datum (bestelldatum, expire) values (now(), adddate(now(), interval 1 year)); Query OK, 1 row affected (0.00 sec) mysql> select * from datum; +---------------------+---------------------+ | bestelldatum | expire | +---------------------+---------------------+ | 2007-11-21 12:39:48 | 2008-11-21 12:39:48 | +---------------------+---------------------+ 1 row in set (0.00 sec)
1 2
my $query = 'INSERT INTO datum (bestelldatum, expire) VALUES( NOW(), ADDDATE(NOW(), INTERVAL 1 YEAR))'; $dbh->do($query);
1 2 3
my $query = 'INSERT INTO datum (bestelldatum, expire, any_column) VALUES( now(), adddate(now(), interval 1 year), ?)'; my @query_data = ( $userinput ); $dbh->do($query, undef, @query_data);
6 Einträge, 1 Seite |