|< 1 2 3 4 >| | 31 Einträge, 4 Seiten |
1
2
3
4
5
6
7
8
9
my $sth_prepare = $dbh1->prepare("select count(id) from userlog group by substring(datestamp,1,10)");
$sth_prepare->execute() or die $DBI::errstr;
print "Content-Type: text/html\n\n";
my $list;
while(my ($count) = $sth_prepare->fetchrow_array()) {
$list .= "$count<br>";
}
print $list;
1
2
3
4
5
6
7
8
9
10
userlog:
id datestamp
1 2004-08-03 14:19:06
2 2004-08-03 14:19:06
3 2004-08-02 14:19:06
select count(id) from userlog group by substring(datestamp,1,10)
1
2
3
4
5
6
my $sth_prepare = $dbh1->prepare("select datestamp, count(id) from userlog group by substring(datestamp,1,10) order by datestamp asc limit 0,7");
$sth_prepare->execute() or die $DBI::errstr;
while (my @arr2 = $sth_prepare->fetchrow_array()) {
push @array, $arr2[1];
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
my $sth_prepare = $dbh1->prepare("select datestamp, count(id) from userlog group by substring(datestamp,1,10) order by datestamp asc limit 0,12");
$sth_prepare->execute() or die $DBI::errstr;
my $day_now;
my $day_old;
my $dif = 1;
my @dif_array = ();
while (my @arr2 = $sth_prepare->fetchrow_array()) {
$day_now = substr($arr2[0],8,2);
$dif = $day_now - $day_old;
push @dif_array, $dif;
for (@dif_array) {
push @array, 0 if $_>1;
}
push @array, $arr2[1];
$day_old = $day_now;
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
my $day_now;
my $day_old = "first";
my $dif = 1;
my @dif_array = ();
while (my @arr2 = $sth_prepare->fetchrow_array()) {
$day_now = substr($arr2[0],8,2);
$dif = $day_now - $day_old unless $day_old eq 'first';
push @dif_array, $dif;
for (@dif_array) {
push @array, 0 while (0..$_);
}
push @array, $arr2[1];
$day_old = $day_now;
}
|< 1 2 3 4 >| | 31 Einträge, 4 Seiten |