SoFunction
Updated on 2025-03-10

Example of base64 processing method for php pagination query mysql results

This article describes the base64 processing method of php pagination querying mysql results. Share it for your reference, as follows:

public function public_about(){
   $sql= ",,,FROM_BASE64() FROM v9_page p JOINv9_category c ON = WHERE  = 'jmwm/'";
   if(isset($_REQUEST['biaoshi'])){
     $sql= ",,, FROM v9_page p JOIN v9_category c = WHERE  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("About Contact");
   $msg['comment']= $mpages;
   echo jsonFormat($msg);
// return_Msg(0,"About Contact",$mpages);}
public function array_to_base64(&$array){
  foreach($array as $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);
    }
  }
}

PS: Here are a few more practical base64 online encoding and decoding tools for everyone to use:

BASE64 encoding and decoding tools:
http://tools./transcoding/base64

Online picture conversion BASE64 tool:
http://tools./transcoding/img2base64

Base64 online encoding and decoding UTF-8 version:
http://tools./tools/base64_decode

Base64 online encoding and decoding gb2312 version:
http://tools./tools/base64_decode

For more information about PHP related content, please check out the topic of this site:PHP+mysql database operation tutorial》、《Summary of php+mysqli database programming skills》、《PHP object-oriented programming tutorial》、《Complete collection of PHP array (Array) operation techniques》、《Summary of usage of php strings》、《Summary of PHP network programming skills"and"Summary of common database operation techniques for php

I hope this article will be helpful to everyone's PHP programming.