php分页查询mysql结果的base64处理方法是什么

本文实例讲述了php分页查询mysql结果的base64处理方法,分享给大家供大家参考,具体如下:

  1. publicfunctionpublic_about(){
  2. $sql="SELECTc.catid,c.catname,c.catdir,FROM_BASE64(p.content) FROM v9_page p JOINv9_category c ON c.catjmwm/'";
  3. if(isset($_REQUEST['biaoshi'])){
  4. $sql="SELECTc.catid,c.catname,c.catdir,p.content FROM v9_page p JOIN v9_category c ONc.cat{$_REQUEST['biaoshi']}%'";
  5. }
  6. $mydb= pc_base::load_model('mymodel');
  7. $mpages=$mydb->query_listinfo($sql);
  8. $this->array_to_base64($mpages);
  9. // $article['content']=base64_encode(toUtf8($article['content']));
  10. $msg=array();
  11. $msg['returncode']="0";
  12. $msg['msg']= togbk("关于联系");
  13. $msg['comment']=$mpages;
  14. echojsonFormat($msg);
  15. // return_Msg(0,"关于联系",$mpages);
  16. }
  17. publicfunctionarray_to_base64(&$array){
  18. foreach($arrayas$key=>$value) {
  19. if(is_array($value)) {
  20. $this->array_to_base64($array[$key]);
  21. }elseif($key=="content"){
  22. $array[$key]=base64_encode(toUtf8($value));
  23. }else{
  24. $array[$key]=togbk($value);
  25. }
  26. }
  27. }