# query_list.php
if(!is_board_exits($board)){
$board="computer";
}
if ($title){
$submit="title";
}
elseif ($cont) {
$submit="cont";
}
elseif ($writer) {
$submit="writer";
}
else {
$submit="title";
}
$sql="select from $board where ($submit like '%$query_str%')";
$temp=mysql_query($sql);
$sum=mysql_num_rows($temp);
if ($sum!=0) {
$sql="select from boardinfo where name='$board'";
$sql_result=mysql_query($sql);
$sql_row=mysql_fetch_array($sql_result);
$chinesename=$sql_row[chinesename];
setcookie ("jl_forum[chinesename]",$chinesename);
$sql="select name from user where slaveboard='$board'";
$sql_result=mysql_query($sql);
?>
List
版面:
版主:$totalpage=ceil($sum/$pagesize);
分页
if($page<1 or empty($page)){
$page=1;
}
elseif ($page>$totalpage){
$page=$totalpage;
}
elseif ($totalpage==0) {
$page=0;
}
$offset=($page-1)$pagesize;
$sql="select from $board where ($submit like '%$query_str%') order by id desc limit $offset,$pagesize";
$sql_result=mysql_query($sql);
?>