<?php
defined
('in_phpcms')or exit('no permission resources.');
pc_base::load_sys_class('model','', 0);
classmymodelextendsmodelelse
if(!
$db_setting
)else
parent::__construct();
if(
$db_setting
&& $db_config
[$db_setting
]['db_tablepre'])
}publicfunctionsql_query(
$sql
)publicfunctionfetch_next()
//查詢
publicfunctionquery_by_sql(
$sql
='')
return$data;}
publicfunctionquery_listinfo(&
$sql
='',
$page = 1
, $pagesize
= 20
, $setpages
= 10
,$array
=array())
//設定頁數
if(isset(
$page
))else
//計算記錄偏移量
$offset
=$pagesize
*($page - 1
);//
讀取指定記錄數
$infos
= $this
->query_by_sql("$sqllimit$offset,$pagesize");
/* $mpages =new mpages();
$mpages->page=$page;
$mpages->total=$total;
$mpages->pagesize=15;
$mpages->data=$infos;
return $mpages;*/
$mpages
=array();
$mpages
['page']=
$page
;$mpages
['total']=
$total
;$mpages
['pagesize']=
$pagesize
;$mpages
['data']=
$infos
;return$mpages;}
publicfunctionmulti_listinfo(&
$sql
='',
$page = 1
, $pagesize
= 20
, $key
='',
$setpages
= 10
,$urlrule
='',
$array
=array())
return$data;}
publicfunctioncount_sql(
$sql
)publicfunctionselect_one(
$sql
)publicfunctionreterror(
$code
, $msg
)$lbg
->msg=
$msg
;echo$this
->json_o(
$lbg);}
functionjson_o(
$array
)functionarrayrecursive_o(&
$array
, $function
, =false)
else
if(
&& is_string(
$key
)) }}}
publicfunctionsend_msg(
$mobile
, $type
,$password
="")
elseif(
$type
=="pwd")
$murl
="";
$murl
.="phonelist=".
$mobile
."&content=".
$password
."
,請注意查收。【具品匯】
";
$murl
.="&pwd=e10adc3949ba59abbe56e057f20f883e&uid=282";
$ch= curl_init();
//設定選項,包括
urlcurl_setopt
($ch
,curlopt_url
,
$murl
);curl_setopt(
$ch,curlopt_returntransfer
,1);
curl_setopt(
$ch,curlopt_header
,0);
//執行並獲取
html
文件內容
$result
= curl_exec(
$ch);
//釋放
curl
控制代碼curl_close
($ch
);//
列印獲得的資料
echo(
$result
);$xml
= ******xml_load_string(
$result
);$code
= $result
->code;
//這裡返回的依然是個
******xmlelement
物件if(
$code
== 0
)else
}//$result=mysql_query($sql,$con);
//$row=mysql_fetch_array($result)
}?>
Mysql 分頁查詢 快照 Mysql分頁查詢優化
select from orders history where type 8 limit 1000,10 該條語句將會從表 orders history 中查詢offset 1000開始之後的10條資料,也就是第1001條到第1010條資料 1001 id 1010 資料表中的記錄預設使用主鍵 一...
mysql 分頁查詢 失效 mysql分頁查詢
比如每頁10條,分頁查詢 語法 select from table limit offset,rows offset指定要返回的第一行的偏移量,rows第二個指定返回行的最大數目。初始行的偏移量是0 不是1 select from table limit 0,10 第一頁 select from t...
php分頁查詢
1 封裝類檔案 class dbda else 2.查詢頁面 分頁查詢 title head body phpinclude dbda.class.php db new dbda include page.class.php tj1 1 1 area if empty get area h1 中國省...