<div align= "center" > <div align= "center" > <br> <br> <div align= "center" > <p align= "left" > <%int Intpagesize;int introwcount;//Total int intpagecount;//page int intpage;//page reference string strpage;//the definition variable is used to transfer pageint i,j;intpagesize=5;// Define the 5 record Strpage=request.getparameter ("page");//Get the Strpage==null {////The initial homepage, if no record is displayed, place the first home intpage=1;} Else{intpage=inTeger.parseint (strpage);//convert Strpage to Integer if (intpage<1) intpage=1;}
if (Types.equals ("null")) {Sqlname= select count (article_id) from learning;} Else{sqlname= "SELECT count (article_id) from learning where types= '" +types+ "";}
Sqlname= "SELECT count (article_id) from learning where title is"% "+keyword+"% ' and types like '% ' "+typename+" by article_id Desc ";
PreparedStatement ps=conn.preparestatement (sqlname); ResultSet rs1=ps.executequery (); Rs1.next (); Introwcount=rs1.getint (1);//Get integer save and Introwcount variable intpagecount= ( INTROWCOUNT+INTPAGESIZE-1)/intpagesize;//calculates the total number (record number + per page of the record-1)/per page recording) if (Intpage>intpagecount) intpage= Intpagecount;
if (Types.equals ("null")) {query= "SELECT * from Learning Order by article_id";} else{query= "SELECT * from learning where types= ' +types+" ' ORDER by article_id ';}
Ps=conn.preparestatement (query);//string query= "SELECT * from Learning Order by article_id";
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.