|
|
mysql_connect($host,$user,$passwd);
if($page==""){
$page=1;
}
if($search=="yes"){
$sql= "select * from mboard_data where b_title like '%$q%' order by b_id desc";
}else{
$sql = "select * from mboard_data where bcat_id=$bcat_id order by b_id desc";
}
$result = mysql_db_query($dbname,$sql) or die ("ไม่พบข้อมูล");
$NRow = mysql_num_rows($result);
$rt = $NRow%$list_page;
if($rt!=0) {
$totalpage = floor($NRow/$list_page)+1;
}
else {
$totalpage = floor($NRow/$list_page);
}
$goto = ($page-1)*$list_page;
if($search=="yes"){
$sql3 = "select * from mboard_data where b_title like '%$q%' order by b_id desc limit $goto,$list_page";
}else{
$sql3 = "select * from mboard_data where bcat_id=$bcat_id order by b_id desc limit $goto,$list_page";
}
$result3 = mysql_db_query($dbname,$sql3) or die ("ไม่พบข้อมูล");
?>
while ($row3 = mysql_fetch_array($result3)) {
$b_id = $row3["b_id"];
$b_title = $row3["b_title"];
$b_auther = $row3["b_auther"];
$b_date = $row3["b_date"];
$b_view = $row3["b_view"];
$b_answer = $row3["b_answer"];
$b_user_id = $row3["user_id"];
if($b_date==$post_date){
$new_gif="";
}else{
$new_gif="";
}
?>
echo"$b_title$new_gif ";
if($admin_login=="yes"){
?>
&bcat_id= echo"$bcat_id"; ?>')" target="_self" title="ลบ">
}
?>
โพสต์โดย echo"·$b_auther";?> เมื่อวันที่ echo"$b_date";?> (อ่าน echo"$b_view";?>/ echo"$b_answer";?> ความเห็น)
|
}
?>
echo"";
echo "\t กำลังแสดงหน้า $page จากทั้งหมด $totalpage หน้า \n";
echo" | ";
?>
|
|
|