  | 
              
	              
	                
  
    
	 
        php การแบ่งหน้า ,, เวลาทำทำการแบ่งหน้าแล้วได้ปกติ แต่พอ พอกดไปที่หน้า 2,3,... มันเป็นค่าว่างคะ งงมากเลย ช่วยด้วยนะคะ     | 
   
  
    |   | 
   
 
 
 
              
  
          
		
     
		
	  
        
             | 
            | 
            | 
             | 
         
        
             | 
                       | 
          
            
               
                 เอาโค้ดมาดูครับว่าคุณเขียนไว้ยังไง ผมคิดว่าน่าจะเป็นเพราะการส่งค่า($_GET,$_POST)แน่เลยครับ ^_^                        
               
               | 
             
            
              
			                              
                              
              
                
                     | 
                     | 
                     | 
                 
                
                     | 
                  
                      
                        | Date :
                            2013-01-08 10:49:40 | 
                        By :
                            arm8957 | 
                         
                    | 
                     | 
                 
                
                     | 
                     | 
                     | 
                 
                | 
             
           
			         | 
             | 
         
        
             | 
            | 
             | 
             | 
         
          
	    
     
               
		
     
		
	  
        
             | 
            | 
            | 
             | 
         
        
             | 
                       | 
          
            
               
                   
 
คือว่า ลองทำแบ่งหน้าตามตัวอย่างในเว็บนี้แล้ว แต่ว่า พอมาลองทำโดยให้อยู่หลังปุ่ม ก็ไม่แสดงค่ะ วานพี่ๆ ช่วยหน่อยนะคะ แก้มาหลายวันแล้ว ไม่ได้สักที ขอบคุณล่วงหน้านะคะ                        
               
               | 
             
            
              
			                              
                              
              
                
                     | 
                     | 
                     | 
                 
                
                     | 
                  
                      
                        | Date :
                            2013-01-08 10:57:19 | 
                        By :
                            kuzneb | 
                         
                    | 
                     | 
                 
                
                     | 
                     | 
                     | 
                 
                | 
             
           
			         | 
             | 
         
        
             | 
            | 
             | 
             | 
         
          
	    
     
               
		
     
		
	  
        
             | 
            | 
            | 
             | 
         
        
             | 
                       | 
          
            
               
                 <?php   
 		if (isset($_POST["type"])) { 
 			$type = $_POST["type_name"]; 
 
		 if ($type ==  "db_monitor" ) { 
				$p1 = "m_"; 
			}elseif ($type =="db_printer" ){ 
				$p1="p_"; 
			} 
	} 
 
	 
	$Qtotal = mysql_query("select * from $type"); 
	$total = mysql_num_rows($Qtotal);  
	 
	$Query = mysql_query("SELECT * FROM $type ORDER BY ".$p1."id DESC LIMIT $start,$limit");  
	$totalp = mysql_num_rows($Query);  
	 
 
?> 
	<table width="1025 "  border ="1"   > 
	<tr> 
		<td width="50"  ><center>รหัส</center>  </td> 
		<td width ="100"><center>รหัสครุภัณฑ์ </center> </td> 
		<td  width ="150"><center>ประเภทครุภัณฑ์  </center></td> 
		<td width ="100"><center>ยี่ห้อ  </center></td> 
		<td width ="150"><center>รุ่น  </center></td> 
		<td width = "200"><center><a href ="comTool.php">.</a></center></td> 
	</tr> 
<?php 
		 
			while ($user_info4=mysql_fetch_array($Query,MYSQL_ASSOC)) { 
			 
				$id2=$user_info4["".$p1."id"]; 
				$serial_id2=$user_info4["".$p1."serial_id"]; 
				$type2=$user_info4["".$p1."type"]; 
				$brand2=$user_info4["".$p1."brand"]; 
				$detail2=$user_info4["".$p1."detail"]; 
				$d2="ดูรายละเอียด"; 
			?> 
			 
			<tr> 
		<td><center><?=$i=$i+1?>  </center></td> 
		<td><center><?=$id2?>  </center></td> 
		<td><center><?=$serial_id2?>  </center></td> 
		<td><center><?=$type2?>  </center></td> 
		<td><center><?=$brand2?>  </center></td> 
		<td><center><?=$detail2?>  </center></td> 
		<td width = "200"><center><a href = "data.php"><?=$d2?></a></center></td> 
	</tr> 
			 
<?php 
				}	// end while 
 
?> 
			 
			</table> 
	<?php 	 
 
		echo "<hr>"; 
		 
	$page = ceil($total/$limit); 
	 
	 
	for($i=1;$i<=$page;$i++){ 
	if($_GET['page']==$i){  
	echo "[<a href='?start=".$limit*($i-1)."&page=$i'><B>$i</B></A>]";  
	}else{ 
	echo "[<a href='?start=".$limit*($i-1)."&page=$i'>$i</A>]";  
	} 
	}	 
	 
?>                        
               
               | 
             
            
              
			                              
                              
              
                
                     | 
                     | 
                     | 
                 
                
                     | 
                  
                      
                        | Date :
                            2013-01-08 11:02:28 | 
                        By :
                            kuzneb | 
                         
                    | 
                     | 
                 
                
                     | 
                     | 
                     | 
                 
                | 
             
           
			         | 
             | 
         
        
             | 
            | 
             | 
             | 
         
          
	    
     
               
		
     
		
	  
        
             | 
            | 
            | 
             | 
         
        
             | 
                       | 
          
            
               
                 ตอนที่ไปหน้า 2 ก็ให้ส่งค่าไปกับ URL ด้วยครับ โดยเงื่อนไขก็ตรวจสอบแบบนี้ครับ 
 
Code (PHP) 
if($_POST["Keyword"] != "")
{
	$strKeyword = $_POST["Keyword"];
}
else
{
	$strKeyword = $_GET["Keyword"];
}
 
 
อันนี้ตอนที่อ่านค่าครับ  มันจะสลับกันระหว่าง $_POST กับ $_GET                        
               
               | 
             
            
              
			  			  
			                              
                              
              
                
                     | 
                     | 
                     | 
                 
                
                     | 
                  
                      
                        | Date :
                            2013-01-08 11:02:37 | 
                        By :
                            mr.win | 
                         
                    | 
                     | 
                 
                
                     | 
                     | 
                     | 
                 
                | 
             
           
			         | 
             | 
         
        
             | 
            | 
             | 
             | 
         
          
	    
     
               
		
     
		
	  
        
             | 
            | 
            | 
             | 
         
        
             | 
                       | 
          
            
               
                 เอาไปแทรกไว้ตรงไหนคะ รบกวนด้วยนะคะ - -"                        
               
               | 
             
            
              
			                              
                              
              
                
                     | 
                     | 
                     | 
                 
                
                     | 
                  
                      
                        | Date :
                            2013-01-08 11:04:19 | 
                        By :
                            kuzneb | 
                         
                    | 
                     | 
                 
                
                     | 
                     | 
                     | 
                 
                | 
             
           
			         | 
             | 
         
        
             | 
            | 
             | 
             | 
         
          
	    
     
      		  
	
     | 
   
 
                 |