|
 |
|
ช่วยหน่อยครับติดปัญหาตรง การแสดง ข้อมูล เป็นหน้าๆ ครับ |
|
 |
|
|
 |
 |
|
เงียบจังเลยๆ
|
 |
 |
 |
 |
Date :
2011-12-20 16:08:17 |
By :
samugla |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณครับอีกเรื่อง นึง คุณ mr.win พอจะทราบไหมครับเรื่อง page อ่ะครับ
|
 |
 |
 |
 |
Date :
2011-12-20 16:56:42 |
By :
samugla |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (PHP)
<head>
<? //include("admin_check.php");?>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874" />
<title>clip all</title>
</head>
<body>
<?
include("my_connect.php");
$strSQL = "SELECT * FROM clip";
//ORDER BY fun_id DESC" ;
$objQuery=mysql_query($strSQL) or die ("error Query[".$strSQL."]");
$Num_Rows = mysql_num_rows($objQuery);
$Per_Page = 1; // 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;
}
$strSQL .=" ORDER BY id DESC LIMIT $Page_Start , $Per_Page";
$objQuery = mysql_query($strSQL);
?>
<table width="1101" height="69" border="0" cellpadding="2">
<tr>
<th width="645" height="30"><div align="left">ชื่อ</div>
</div></th>
<th width="195">วันที่</div></th>
<th width="68">ดู</div></th>
<th width="78">ผู้ทำรายการ</th>
<th width="33">แก้ไข</th>
<th width="44">ลบ</th>
</tr>
<?
while($objResult = mysql_fetch_array($objQuery))
{
?>
<tr>
<td height="33"><?=$objResult["name"];?></td>
<td><?=$objResult["clip_now"];?>
<div align="center"></div>
<div align="center"></div></td>
<td> <div align="center">
<?=$objResult["view"];?>
</div></td>
<td> <div align="center">
<?=$objResult["user"];?>
</div></td>
<td ><a href="update_from.php?code=<?=$objResult["id"];?>">แก้ไข</a></td>
<td ><a href="JavaScript:if(confirm('Confirm Delete?')==true){window.location='delete.php?code=<?=$objResult["id"];?>';}">ลบ</a></td>
</tr>
<?
}
?>
</table>
<br>
ทั้งหมด
<?= $Num_Rows;?>
Record :
<?=$Num_Pages;?>
Page :
<?
if($Prev_Page)
{
echo " <a href='?menupage=funny&Page=$Prev_Page'><< Back</a> ";
}
for($i=1; $i<=$Num_Pages; $i++){
if($i != $Page)
{
echo "[ <a href='?menupage=funny&Page=$i'>$i</a> ]";
}
else
{
echo "<b> $i </b>";
}
}
if($Page!=$Num_Pages)
{
echo " <a href ='?menupage=funny&Page=$Next_Page'>Next>></a> ";
}
//mysql_close($objConnect);
?>
</body>
</html>
|
 |
 |
 |
 |
Date :
2011-12-20 17:34:09 |
By :
Manussawin |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ยังไงครับ 
|
 |
 |
 |
 |
Date :
2011-12-20 17:35:40 |
By :
webmaster |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ได้แล้วครับขอบคุณ พี่ๆ ทุกคนวันหลังจะมารบกวนใหม่ 
|
 |
 |
 |
 |
Date :
2011-12-20 20:56:18 |
By :
samugla |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอรบกวนพี่ๆอีกครั้งครับคือผมเพิ่ม ระบบค้นหาเพิ่มมาอีก แต่ก็ยังไม่ได้อยู่ดีอ่ะครับ คือ เหมือนค่าที่กรอกหน้าฟรอม์มันไม่ยอมส่งมาที่หน้าแสดงผลอ่ะครับ อ่ะครับ รบกวนดูให้หน่อยน่ะครับ
ตัวนี้หน้า from ครับCode (PHP)
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874" />
<title>Untitled Document</title>
</head>
<body>
<form name="frmSearch" method="post" action="index.php?menupage=search">
<table width="599" border="1">
<tr>
<th>ชื่อ
<input name="txtKeyword" type="text" id="txtKeyword" value="<?=$_POST["txtKeyword"];?>">
<input type="submit" value="Search"></th>
</tr>
</table>
</form>
</body>
</html>
แล้วอันนี้code ที่เพิ่มมา ในหน้า index.php ที่อยู่ข้างบนอ่ะครับ
Code (PHP)
case"search":
include("search.php");
break;
ส่วนตัวนี้ code ที่แสดงผล อ่ะครับ search.php แล้วลิ้งที่ กดแล้วไปอีกหน้านึงต้องใส่เป็นอ่ะไรอ่ะครับ
Code (PHP)
<head>
<? include("admin_check.php");
include("my_connect.php");
include("hi_light.js");
$strSQL = "SELECT * FROM clip WHERE (name LIKE '%".$_POST["txtKeyword"]."%' or clip_key LIKE '%".$_POST["txtKeyword"]."%')";
$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
$Num_Rows = mysql_num_rows($objQuery);
$Per_Page = 2; // 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;
}
$strSQL .=" order by clip ASC LIMIT $Page_Start , $Per_Page";
$objQuery = mysql_query($strSQL);
?>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874" />
<title>Untitled Document</title>
</head>
<body>
ค้นหา
<table id="table" width="100%" height="69" border="0" cellpadding="2">
<tr>
<th width="45%" height="30"><div align="left">ชื่อ</div>
</div></th>
<th width="8%">ประเภท</th>
<th width="21%">วันที่</div></th>
<th width="6%">ดู</div></th>
<th width="9%">ผู้ทำรายการ</th>
<th width="5%">แก้ไข</th>
<th width="6%">ลบ</th>
</tr>
<?
while($objResult = mysql_fetch_array($objQuery))
{
?>
<tr>
<td height="33"><?=$objResult["name"];?></td>
<td><div align="center">
<?=$objResult["type"];?>
</div></td>
<td><div align="center">
<?=$objResult["clip_now"];?>
</div>
<div align="center"></div>
<div align="center"></div></td>
<td> <div align="center">
<?=$objResult["view"];?>
</div></td>
<td> <div align="center">
<?=$objResult["user"];?>
</div></td>
<td ><a href="update_from.php?code=<?=$objResult["id"];?>">แก้ไข</a></td>
<td ><a href="JavaScript:if(confirm('Confirm Delete?')==true){window.location='delete.php?code=<?=$objResult["id"];?>';}">ลบ</a></td>
</tr>
<?
}
?>
</table>
<br>
ทั้งหมด
<?= $Num_Rows;?>
Record :
<?=$Num_Pages;?>
Page :
<?
if($Prev_Page)
{
echo " <a href='?menupage=search&Page=$Prev_Page'><< Back</a> ";
}
for($i=1; $i<=$Num_Pages; $i++){
if($i != $Page)
{
echo "[ <a href='?menupage=search&Page=$i'>$i</a> ]";
}
else
{
echo "<b> $i </b>";
}
}
if($Page!=$Num_Pages)
{
echo " <a href ='?menupage=search&Page=$Next_Page'>Next>></a> ";
}
//mysql_close($objConnect);
?>
</body>
</html>
วอนผู้รู้ชวยที่น่ะครับ พอดีจะรีบส่งอาจารย์ ขอบคุณครับ
|
 |
 |
 |
 |
Date :
2011-12-23 22:51:39 |
By :
samugla |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ส่ง txtKeyword ไปกับ menupage=search&Page=$i ด้วย แล้วเปลี่ยนไปรับด้วย $_REQUEST
|
 |
 |
 |
 |
Date :
2011-12-24 03:25:26 |
By :
ikikkok |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ยังไงอ่ะครับขอตัวอย่างหน่อยสิครับ
|
 |
 |
 |
 |
Date :
2011-12-24 07:16:39 |
By :
samugla |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (PHP)
<a href ='?menupage=$_GET[menupage]&Page=$Next_Page'>Next>></a>
คุณจะต้องส่งค่าไปด้วยครับ
|
 |
 |
 |
 |
Date :
2011-12-24 08:11:01 |
By :
webmaster |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
อ่อครับเดี่ยวผมลองดูแต่ปัญหลักๆมันเกิดตรงที่ว่า กด search แล้วมันไม่ยอมค้นหาให้อ่ะครับ
|
 |
 |
 |
 |
Date :
2011-12-24 08:24:17 |
By :
samugla |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
มันไม่ยอมค้นหาข้อมูลให้อ่ะครับต้องทำยังไงหรอครับ
Code (PHP)
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874" />
<title>Untitled Document</title>
</head>
<body>
<form name="frmSearch" method="post" action="index.php?menupage=search"> //แก้จากตรงนี้รึป่าวครับ
<table width="599" border="1">
<tr>
<th>ชื่อ
<input name="txtKeyword" type="text" id="txtKeyword" value="<?=$_POST["txtKeyword"];?>">
<input type="submit" value="Search"></th>
</tr>
</table>
</form>
</body>
</html>
|
 |
 |
 |
 |
Date :
2011-12-24 15:32:49 |
By :
samugla |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 05
|