IIS+CGI+PHP+Mysql就是这些项目的组合
应用比较广泛
http://www.czboy.com/bbs/printpage.asp?BoardID=5&ID=65
这里可以作为参考
这是我的一个测试代码,你自己试下use strict
use CGI
use DBI
my $req=CGI->new()
print $req->header
print $req->start_html
my $page=$req->param("page") || 1
my $dbh=DBI->connect(
"DBI:mysql:database:localhost","root","aaa",{
PrintError =>1,#出错时warn()
RaiseError =>0,#错误时并不结束执行
AutoCommit =>1,#立即提交
}
)
my $sql="SELECT * FROM alter_splicing limit ".(($page-1)*10).",20"
print $req->p("查询语句:$sql")
my $sth=$dbh->prepare($sql)
$sth->execute
while(my @row=$sth->fetchrow_array){
print "<li>$row[0]</li>"
}
$dbh->disconnect()
}
my $prev=$page-1
my $next=$page+1
print $req->p(qq(<a href="?page=1">首页</a>| <a href="?page=$prev">上页</a>| <a href="?page=$next">下页</a>))
print $req->end_html
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)