【www.bbyears.com--mysql教程】
word-wrap: break-word; margin: 5px 0px; color: rgb(0, 0, 0); font-family: 'sans serif', tahoma, verdana, helvetica; font-size: 13.3333px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 20px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px; -webkit-text-stroke-width: 0px;">本文实例讲述了php分页查询mysql结果的base64处理方法。分享给大家供大家参考,具体如下:
代码如下
publicfunctionpublic_about(){
$sql="SELECTc.catid,c.catname,c.catdir,FROM_BASE64(p.content) FROM v9_page p JOINv9_category c ON c.catid=p.catid WHERE c.parentdir = 'jmwm/'";
if(isset($_REQUEST['biaoshi'])){
$sql="SELECTc.catid,c.catname,c.catdir,p.content FROM v9_page p JOIN v9_category c ONc.catid=p.catid WHERE c.catdir LIKE '{$_REQUEST['biaoshi']}%'";
}
$mydb= pc_base::load_model('mymodel');
$mpages=$mydb->query_listinfo($sql);
$this->array_to_base64($mpages);
// $article['content']=base64_encode(toUtf8($article['content']));
$msg=array();
$msg['returncode']="0";
$msg['msg']= togbk("关于联系");
$msg['comment']=$mpages;
echojsonFormat($msg);
// return_Msg(0,"关于联系",$mpages);
}
publicfunctionarray_to_base64(&$array){
foreach($arrayas$key=>$value) {
if(is_array($value)) {
$this->array_to_base64($array[$key]);
}elseif($key=="content"){
$array[$key]=base64_encode(toUtf8($value));
}else{
$array[$key]=togbk($value);
}
}
}