|
 |
|
รบกวนดูให้หน่อยค่ะว่าทำไมกดหน้าถัดไปข้อมูลไม่ขึ้นมาค่ะ |
|
 |
|
|
 |
 |
|
Code (PHP)
<script>
function returnVal(search_type,obj_tr){
window.opener.on_returnVal(search_type,obj_tr);
window.close();
}
</script>
<body onload="this.focus()">
<table align="center" width="95%">
<tr>
<td colspan="2" align="center" ><font color="#000000" size="5" face="Arial, Helvetica, sans-serif">ผู้ติดต่อกับผู้ขาย</font></td>
</tr>
<tr>
<td align="center"><font color="#000000" size="3" face="Arial, Helvetica, sans-serif">รหัสผู้ติดต่อกับผู้ขาย</font></td>
<td align="center"><font color="#000000" size="3" face="Arial, Helvetica, sans-serif">ผู้ติดต่อกับผู้ขาย</font></td>
</tr>
<?
$search_type=$_GET[search_type];
$search_txt=$_GET[search_txt];
if($search_type==1){
$sql_showconnecter="select * from tblconnecter WHERE (id_connecter LIKE '%".$_GET["search_connecter_txt"]."%') or (name_connecter LIKE '%".$_GET["search_connecter_txt"]."%')";
$sql_showconnecter1=mysql_query($sql_showconnecter);
$Num_Rows = mysql_num_rows($sql_showconnecter1);
$Per_Page = 5; // Per Page
$Page = $_GET["Page"];
if(!$_GET["Page"])
{
$Page=1;
}
$Prev_Page = $Page-1;
$Next_Page = $Page+1;
$Page_Start = (($Per_Page*$Page)-$Per_Page);
if($Num_Rows<=$Per_Page)
{
$Num_Pages =1;
}
else if(($Num_Rows % $Per_Page)==0)
{
$Num_Pages =($Num_Rows/$Per_Page) ;
}
else
{
$Num_Pages =($Num_Rows/$Per_Page)+1;
$Num_Pages = (int)$Num_Pages;
}
$sql_showconnecter .=" order by id_connecter ASC LIMIT $Page_Start , $Per_Page";
$sql_showconnecter1 = mysql_query($sql_showconnecter);
while($result_showconnecter=mysql_fetch_array($sql_showconnecter1))
{
?>
<tr style="cursor:pointer" ondblclick="returnVal('<?=$search_type?>',this)">
<td ><?=$result_showconnecter["id_connecter"];?></td>
<td >คุณ <?=$result_showconnecter["name_connecter"];?> <?=$result_showconnecter["lastname_connecter"];?></td>
</tr>
<?
}
?>
<tr>
<td colspan="2"><font color="#000000" size="3" face="Arial, Helvetica, sans-serif">
<font color="#000000" size="3" face="Arial, Helvetica, sans-serif">ทั้งหมด <?= $Num_Rows;?> จากจำนวน : <?=$Num_Pages;?> หน้า :</font>
<?
if($Prev_Page)
{
echo "<font color=\"#000000\" size=\"3\" face=\"Arial, Helvetica, sans-serif\"> <a href='$_SERVER[SCRIPT_NAME]?Page=$Prev_Page'><< Back</a></font> ";
}
for($i=1; $i<=$Num_Pages; $i++)
{
if($i != $Page)
{
echo "<font color=\"#000000\" size=\"3\" face=\"Arial, Helvetica, sans-serif\"> [ <a href='$_SERVER[SCRIPT_NAME]?Page=$i'>$i</a> ]</font>";
}
else
{
echo "<font color=\"#000000\" size=\"3\" face=\"Arial, Helvetica, sans-serif\"> <b> $i </b></font>";
}
}
if($Page!=$Num_Pages)
{
echo " <font color=\"#000000\" size=\"3\" face=\"Arial, Helvetica, sans-serif\"> <a href ='$_SERVER[SCRIPT_NAME]?Page=$Next_Page'>Next>></a></ ";
}
}
Tag : PHP, MySQL

|
|
 |
 |
 |
 |
Date :
2011-10-05 10:46:31 |
By :
deedee2338 |
View :
748 |
Reply :
4 |
|
 |
 |
 |
 |
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (PHP)
$search_type=$_GET[search_type];
'$_SERVER[SCRIPT_NAME]?Page=$Next_Page&search_type=$search_type
ส่งคาตัวแปรไปด้วยครับ
คือจะใช้อะไร ก็ส่งไปด้วยครับ
|
 |
 |
 |
 |
Date :
2011-10-05 13:28:33 |
By :
webmaster |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
แก้ไขบรรทัดนี้เปล่าค่ะแก้แล้วไม่ได้เหมือนเดิมค่ะ
Code (PHP)
if($Page!=$Num_Pages)
{
echo " <font color=\"#000000\" size=\"3\" face=\"Arial, Helvetica, sans-serif\"> <a href ='$_SERVER[SCRIPT_NAME]?Page=$Next_Page&search_type=$search_type'>Next>></a></ ";
}
|
 |
 |
 |
 |
Date :
2011-10-05 14:01:24 |
By :
deedee2338 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ส่ง search_txt ไปด้วยครับ
|
 |
 |
 |
 |
Date :
2011-10-05 14:12:44 |
By :
ikikkok |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (PHP)
echo " <font color=\"#000000\" size=\"3\" face=\"Arial, Helvetica, sans-serif\"> <a href ='$_SERVER[SCRIPT_NAME]?Page=$Next_Page&search_type=$search_type&search_txt=$search_txt'>Next>></a></font>";
ใส่แบบนี้เปล่าไม่ได้เหมือนเดิม
|
 |
 |
 |
 |
Date :
2011-10-05 14:26:00 |
By :
deedee2338 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 04
|