WordPress数据库错误: [Got error 28 from storage engine]
SHOW FULL COLUMNS FROM `wp_options`

WordPress数据库错误: [Got error 28 from storage engine]
SELECT t.*, tt.*, tr.object_id FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt ON t.term_id = tt.term_id INNER JOIN wp_term_relationships AS tr ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN ('category', 'post_tag', 'post_format') AND tr.object_id IN (3) ORDER BY t.name ASC

PHP翻页方法 – Crazy knowledge base
Crazy knowledge base

PHP翻页方法

$page = $_REQUEST["page"];
$perPage = 15;
$startnum = ((($page > 1)?$page:1)-1) * $perPage;
$endnum = $perPage;
$totalnum = $wpdb->get_var("SELECT count(*) FROM member order by id desc");
$pages = ceil($totalnum/$perPage);
$comments = $wpdb->get_results("SELECT * FROM member limit $startnum,$endnum");

echo paging($pages, "page");

function paging(
 $pages,
 $pagevar="page",
 $ppv=10,
 $first ="««« ",
 $firsts ="««« ",
 $prev ="««  ",
 $prevs ="««  ",
 $num ="{page}",
 $nums ="{page}",
 $sep =" | ",
 $more ="[...]",
 $next ="  »»",
 $nexts ="  »»",
 $last =" »»»",
 $lasts =" »»»"){

 // get URI parameters
 $getvars=$_SERVER['PHP_SELF']."?";
 foreach ($_GET as $key => $val){
  if ($key!=$pagevar){
   if (isset($val) && $val!=""){
    $getvars.="$key=$val&";
   }else{
    $getvars.="$key&";
   }
  }
 }

 $page=(is_numeric($_GET[$pagevar])) ? $_GET[$pagevar] : 1;
 $page=($page>$pages) ? $pages : $page;
 $prevpage=($page>1) ? $page-1 : 1;
 $nextpage=($page < $pages) ? $page+1 : $pages;
 $paging="";

 if ($pages>1){
  // first
  $paging.=($page>1) ? str_replace("{url}", "$getvars$pagevar=1", $first) : $firsts;
  // prev
  $paging.=($page>1) ? str_replace("{url}", "$getvars$pagevar=$prevpage", $prev) : $prevs;

  // pages
  $ppvrange=ceil($page/$ppv);
  $start=($ppvrange-1)*$ppv;
  $end=($ppvrange-1)*$ppv+$ppv;
  $end=($end>$pages) ? $pages : $end;
  $paging.=($start>1) ? str_replace("{url}", "$getvars$pagevar=".($start-1), $more).$sep : "";
  for ($i=1; $i<=$pages; $i++){
   if ($i>$start && $i<= $end){
    $paging.=($page==$i) ? str_replace("{page}", $i, $nums).(($i<$end) ? $sep : "") : str_replace(array("{url}", "{page}"), array("$getvars$pagevar=$i", $i), $num).(($i<$end) ? $sep : "");
   }
  }
  $paging.=($end<$pages) ? $sep.str_replace("{url}", "$getvars$pagevar=".($end+1), $more) : "" ;

  // next
  $paging.=($page<$pages) ? str_replace("{url}", "$getvars$pagevar=$nextpage", $next) : $nexts;
  // last
  $paging.=($page<$pages) ? str_replace("{url}", "$getvars$pagevar=$pages", $last) : $lasts;
 }

 return $paging;
}
PHP翻页方法

WordPress数据库错误: [Got error 28 from storage engine]
SELECT t.*, tt.* FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt ON t.term_id = tt.term_id INNER JOIN wp_term_relationships AS tr ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN ('category') AND tr.object_id IN (1) ORDER BY t.name ASC

WordPress数据库错误: [Got error 28 from storage engine]
SELECT t.*, tt.* FROM wp_terms AS t INNER JOIN wp_term_taxonomy AS tt ON t.term_id = tt.term_id INNER JOIN wp_term_relationships AS tr ON tr.term_taxonomy_id = tt.term_taxonomy_id WHERE tt.taxonomy IN ('category') AND tr.object_id IN (4) ORDER BY t.name ASC

滚动到顶部