[$ var $dbh $sth @dat $issue $total $] [- $http_headers_out{'Cache-Control'} = "no-cache"; $http_headers_out{'Pragma'} = "no-cache"; #$http_headers_out{'Expires'} = "0"; $dbh = DBI->connect($ENV{COUNTER}, $ENV{SESSION_DBI_USERNAME}, $ENV{SESSION_DBI_PASSWORD}) || die "Cannot connect to db"; $sth = $dbh->prepare("UPDATE counter SET countView=countView+1 WHERE ID=35"); $sth->execute; $sth->finish; $dbh->disconnect; $dbh = DBI->connect($ENV{_SPECIAL}, $ENV{SESSION_DBI_USERNAME}, $ENV{SESSION_DBI_PASSWORD}) || die "Cannot CONNECT DB"; $total = ""; $issue = ""; $sth = $dbh->prepare("SELECT COUNT(*) FROM matchComic2005 WHERE approval=1 AND time<=NOW()"); $sth->execute; ($total) = $sth->fetchrow_array; $sth->finish; if($fdat{pageno} ne "") { $issue = int($fdat{pageno}); $sth = $dbh->prepare("SELECT COUNT(*) FROM matchComic2005 WHERE approval=1 AND issue_no=? AND time<=NOW()"); $sth->execute($issue); @dat = $sth->fetchrow_array; $sth->finish; } elsif(!defined $fdat{pageno} || $fdat{pageno} eq "" || $dat[0]==0) { $sth = $dbh->prepare("SELECT issue_no FROM matchComic2005 WHERE approval=1 AND time<=NOW() ORDER BY issue_no DESC LIMIT 1"); $sth->execute; ($issue) = $sth->fetchrow_array; $sth->finish; } -] 火柴人漫畫[+ $issue +]
[- $sth = $dbh->prepare("SELECT ID, title, image FROM matchComic2005 WHERE issue_no=? AND approval=1"); $sth->execute($issue); @dat = $sth->fetchrow_array; $sth->finish; -]
火柴人日記
([+ $issue +]) — [+ $dat[1] +] [$ if($issue<$total) $] [$ endif $] [$ if($issue!=1) $] [$ endif $] 跳至第 | 集數:[+ $issue +] / [+ $total +]
[- $dbh->disconnect; -]