All pastes #743496 Raw Edit

Stuff

public text v1 · immutable
·published 2007-10-20 14:26 UTC
rendered paste body
#!/usr/bin/perl
$|=1;
$debug = 1; 
my %dttime = ();
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
$dttime{year }  = sprintf "%04d",($year + 1900);
$dttime{mon  }  = sprintf "%02d",($mon + 1);
$dttime{mday }  = sprintf "%02d",$mday; 
my $date= $dttime{year}-$dttime{mon}-$dttime{mday};
print "$date";
my $dbh = mysql_connection();
my $sql = "insert into regusers set  date='$date'";
my $sth = $dbh->prepare($sql);
$sth->execute or die "Unable to execute SQL query: $dbh->errstr\n";
 $dbh->disconnect; 
exit;