asp和mysql分页代码
<!--#include file="zheboconn.asp"-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GB2312" />
<title>asp和mysql分页代码</title>
<style type="text/css">
<!--
.STYLE3 {
font-size: 15px;
font-family: "宋体";
color: #000000;
}
img{border:none}
.STYLE1 {
font-family: "文鼎CS中黑";
color: #ffffff;
font-size: 18px;
}
-->
</style>
</head>
<body scroll="no"> //去掉滚动条
<table width="97%" border="0" align="center" scroll="no">
<tr>
<td height="35" valign="top"><%
'asp+mysql分页
Dim strSql,Rs
Dim intRecordNum,intCurrentPage,intRowcount
Dim intPageCount:intPageCount = 5 '每页5条记录
intRowcount = 0
'获得总记录
Set Rs = Conn.Execute("SELECT COUNT(*) As intcounts from 表名")
If Rs.Eof And Rs.Bof Then
intRecordNum = 0
Else
intRecordNum = Cint(Rs("intcounts"))
End If
Dim intTotalPages
If (intRecordNum mod intPageCount)>0 Then
intTotalPages = Int(intRecordNum/intPageCount) + 1
Else
intTotalPages = intRecordNum/intPageCount
End If
intCurrentPage = 1
If IsEmpty(Request("intCurrentPage")) Or IsNull(Request("intCurrentPage")) Or Trim(Request("intCurrentPage"))="" Or (Not IsNumeric(Request("intCurrentPage"))) Or Len(Request("intCurrentPage"))>8 Then
intCurrentPage = 1
ElseIf Clng(Request("intCurrentPage")) < 1 Then
intCurrentPage = 1
ElseIf Clng(Request("intCurrentPage")) > intTotalPages Then
intCurrentPage = intTotalPages
Else
intCurrentPage = Clng(Request("intCurrentPage"))
End If
Set Rs = Nothing
Set Rs = Server.CreateObject("ADODB.RecordSet")
strSql = "SELECT * from 表名 Order By id DESC LIMIT " & (i
相关文档:
JMAIL安装配置
jmail发送邮件的实例代码网上很多.但是有些细节如果不配置好,发送失败的可能性很大.
首先说明一下jmail安装配置步骤:
1. JMail 下载地址
http://hbdx3.skycn.com/down/w3JMail43Personal.exe
2.安装
本人在Windows 2003下面配置,其它系统还没有测试.
安装到目录比如: C:\Program Files\Dimac\w3JMai ......
一、安装
1. 首先安装SSH
sudo apt-get install ssh
2.安装MySQL(虽然现在最新版为5.1,但是还只能装5.0版本)
sudo apt-get install mysql-server-5.0
3.安装Apache
sudo apt-get install apache2
4.安装PHP
sudo apt-get install php5 libapache2-mod-php5
5.重启Apache
sudo /etc/init.d/apache2 restart ......
建立一个主外键关系
create table t_dept(
id int(4) not null, name varchar(50) not null,
primary key(id))type=innodb;
create table t_emp (
id int(6) not null,
name char(255) not null,fk_id int(4) not null,
primary key(id),
foreign key (fk_id) references t_dept (id)) type=innodb; ......
1、进入mysql,创建一个新用户xuys:
格式:grant 权限 on 数据库名.表名 用户@登录主机 identified by "用户密码";
grant select,update,insert,delete on *.* to xuys@192.168.88.234 identified by "xuys1234";
查看结果,执行:
use mysql;
select host,user,p ......
查询是数据库技术中最常用的操作。查询操作的过程比较简单,首先从客户端发出查询的SQL语句,数据库服务端在接收到由客户端发来的SQL语句后,执行这条SQL语句,然后将查询到的结果返回给客户端。虽然过程很简单,但不同的查询方式和数据库设置,对查询的性能将会有很在的影响。
因此,本文就在MySQL中常用的查询优化技术进 ......