日韩天天综合网_野战两个奶头被亲到高潮_亚洲日韩欧美精品综合_av女人天堂污污污_视频一区**字幕无弹窗_国产亚洲欧美小视频_国内性爱精品在线免费视频_国产一级电影在线播放_日韩欧美内地福利_亚洲一二三不卡片区

解析用PHP操作MySql數(shù)據(jù)庫(kù)(3)_PHP教程

編輯Tag賺U幣
教程Tag:暫無Tag,歡迎添加,賺取U幣!

str = "";
for (i=start_p; i<=end_p; i++){
if (i==this->page){
str.= " <strong>".i."</strong> ";
}else{
str.= " <a href=’".this->url.i."’>".i."</a> ";
}
}
return str;
}
function show_page_info(){
str = " 共".this->total_records."條/".this->total_pages."頁(yè)";
return str;
}
function show_page(){
if (this->total_records<1){
this->set_show_page();
}
str = this->total_pages>1 ? this->show_first_prv().this->show_num_btn().this->show_next_last().this->show_page_info().this->show_num_text():"";
return str;
}
//總頁(yè)數(shù)
function set_total_pages(){
this->total_pages = ceil(this->total_records/this->page_size);
}
//總記錄數(shù)
function set_total_records(){
if (this->total_records==0 or !isset(this->total_records)){
if (empty(this->count_sql) and !empty(this->table["tablename"])){
sql = "SELECT count(".this->table["id"].") as count_id FROM `".this->table["tablename"]."` ".(this->table["where"]!=""?" WHERE ".this->table["where"]:"");
}else{
sql = preg_replace("/SELECT(.*?)FROM(.*?)/i", "SELECT count(id) AS count_id FROM\\2", this->sql);
}
arr = this->db->row_query_one(sql);
this->total_records = arr["count_id"];
}
}
/*
* 根據(jù)sql返回查詢數(shù)據(jù)
* 指定sql時(shí),不必指定limit
*/
function get_rows_by_sql(sql){
this->sql = sql." LIMIT ".this->page_size*(this->page-1).", ".this->page_size; //指定的SQL;
return this->db->row_query(this->sql);
}

來源:模板無憂//所屬分類:PHP教程/更新時(shí)間:2010-02-23
相關(guān)PHP教程