  | 
              
	              
	                
  
    
	 
        อยากทราบว่าทำไมมันขึ้นหลายอัน งง คะ ไม่ทราบว่าทำอะไรผิดยังไงคะ     | 
   
  
    |   | 
   
 
 
 
              
  
          
		
     
		
	  
        
             | 
            | 
            | 
             | 
         
        
             | 
                       | 
          
            
               
                 จาก code คุณ มันขึ้นหลายการก็ถูกแล้วน่ะครับ 
คุณใช้ select * from cusorder where 1=1 order by MemberID desc 
แบบนี้มันก็ออกมาหมดทุก MemberID  
 
เพราะงั้นถ้าอยากได้รายการเดียว 
ลองปรับ query แบบนี้ครับ 
Code (PHP) 
		<? 
  		   if(!empty($_GET["MemberID"]))
			{
			$MemberID=$_GET[MemberID];
			 //=========== ทำการ query เพื่อเลือกรายการสินค้า
			//$sql_product = "select * from cusorder where 1=1 order by MemberID desc";
                         $sql_product = "select * from cusorder where MemberID = $MemberID order by MemberID desc";
			$dbquery_product = mysql_query($sql_product);
			//$num_rows_product = mysql_num_rows($dbquery_product);
			while ($result= mysql_fetch_array($dbquery_product))
			{
			?>
        </a><a href="cusorder.php?MemberID=<?=$result["MemberID"];?>">     รายการสั่งซื้อ</a><br> <? } 
}
?>
                        
               
               | 
             
            
              
			                              
                              
              
                
                     | 
                     | 
                     | 
                 
                
                     | 
                  
                      
                        | Date :
                            2013-05-02 00:19:18 | 
                        By :
                            mangkunzo | 
                         
                    | 
                     | 
                 
                
                     | 
                     | 
                     | 
                 
                | 
             
           
			         | 
             | 
         
        
             | 
            | 
             | 
             | 
         
          
	    
     
               
		
     
		
	  
        
             | 
            | 
            | 
             | 
         
        
             | 
                       | 
          
            
               
                 ไม่ขึ้นอะไรเลยคะ ไม่ขึ้นเลย รบกวนหน่อยคะ                        
               
               | 
             
            
              
			                              
                              
              
                
                     | 
                     | 
                     | 
                 
                
                     | 
                  
                      
                        | Date :
                            2013-05-02 08:58:40 | 
                        By :
                            NToo | 
                         
                    | 
                     | 
                 
                
                     | 
                     | 
                     | 
                 
                | 
             
           
			         | 
             | 
         
        
             | 
            | 
             | 
             | 
         
          
	    
     
               
		
     
		
	  
        
             | 
            | 
            | 
             | 
         
        
             | 
                       | 
          
            
               
                 Code (PHP) 
		<? 
  		   if(!empty($_GET["MemberID"]))
			{
			$MemberID=$_GET[MemberID];
			 //=========== ทำการ query เพื่อเลือกรายการสินค้า
			//$sql_product = "select * from cusorder where 1=1 order by MemberID desc";
                         $sql_product = "select * from cusorder where MemberID = 1 order by MemberID desc";
			$dbquery_product = mysql_query($sql_product);
			//$num_rows_product = mysql_num_rows($dbquery_product);
			while ($result= mysql_fetch_array($dbquery_product))
			{
			?>
        </a><a href="cusorder.php?MemberID=<?=$result["MemberID"];?>">     รายการสั่งซื้อ</a><br> <? } 
}
?>
 
 
เอาแบบนี้ครับ                        
               
               | 
             
            
              
			                              
                              
              
                
                     | 
                     | 
                     | 
                 
                
                     | 
                  
                      
                        | Date :
                            2013-05-02 09:05:43 | 
                        By :
                            pklangkua | 
                         
                    | 
                     | 
                 
                
                     | 
                     | 
                     | 
                 
                | 
             
           
			         | 
             | 
         
        
             | 
            | 
             | 
             | 
         
          
	    
     
               
		
     
		
	  
        
             | 
            | 
            | 
             | 
         
        
             | 
                       | 
          
            
               
                 ไม่ขึ้นอะไรเลยเหมือนกันคะ รบกวนหน่อยนะคะ                        
               
               | 
             
            
              
			                              
                              
              
                
                     | 
                     | 
                     | 
                 
                
                     | 
                  
                      
                        | Date :
                            2013-05-02 09:22:27 | 
                        By :
                            NToo | 
                         
                    | 
                     | 
                 
                
                     | 
                     | 
                     | 
                 
                | 
             
           
			         | 
             | 
         
        
             | 
            | 
             | 
             | 
         
          
	    
     
               
		
     
		
	  
        
             | 
            | 
            | 
             | 
         
        
             | 
                       | 
          
            
               
                 มันไม่ขึ้น รายการสั่งซื้อ คะ                        
               
               | 
             
            
              
			                              
                              
              
                
                     | 
                     | 
                     | 
                 
                
                     | 
                  
                      
                        | Date :
                            2013-05-02 14:10:36 | 
                        By :
                            NToo | 
                         
                    | 
                     | 
                 
                
                     | 
                     | 
                     | 
                 
                | 
             
           
			         | 
             | 
         
        
             | 
            | 
             | 
             | 
         
          
	    
     
               
		
     
		
	  
        
             | 
            | 
            | 
             | 
         
        
             | 
                       | 
          
            
               
                 อ่าน code แล้วประยุกต์ซักนิด จะดีมากเลยครับ 
Code (PHP) 
        <?php 
        if(!empty($_GET["MemberID"])){
            $MemberID=$_GET[MemberID];
            $sql_product = "select * from cusorder where MemberID = $MemberID order by MemberID desc";
        }else{
            $sql_product = "select * from cusorder by MemberID desc";
        }
        $dbquery_product = mysql_query($sql_product);
        //$num_rows_product = mysql_num_rows($dbquery_product);
        while ($result= mysql_fetch_array($dbquery_product)){?>
            <a href="cusorder.php?MemberID=<?=$result["MemberID"];?>">     รายการสั่งซื้อ</a><br>
        <?php 
        } ?>
                        
               
               | 
             
            
              
			                              
                              
              
                
                     | 
                     | 
                     | 
                 
                
                     | 
                  
                      
                        | Date :
                            2013-05-04 10:23:29 | 
                        By :
                            mangkunzo | 
                         
                    | 
                     | 
                 
                
                     | 
                     | 
                     | 
                 
                | 
             
           
			         | 
             | 
         
        
             | 
            | 
             | 
             | 
         
          
	    
     
               
		
     
		
	  
        
             | 
            | 
            | 
             | 
         
        
             | 
                       | 
          
            
               
                 ขอโทษนะคะ ขึ้นอย่างนี้คะ Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\AppServ\www\Carshop\menuleft.php on line 120                        
               
               | 
             
            
              
			                              
                              
              
                
                     | 
                     | 
                     | 
                 
                
                     | 
                  
                      
                        | Date :
                            2013-05-06 17:36:20 | 
                        By :
                            NToo | 
                         
                    | 
                     | 
                 
                
                     | 
                     | 
                     | 
                 
                | 
             
           
			         | 
             | 
         
        
             | 
            | 
             | 
             | 
         
          
	    
     
               
		
     
		
	  
        
             | 
            | 
            | 
             | 
         
        
             | 
                       | 
          
            
               
                 แก้ไข โดยเขียนแบบนี้ มันก็ไม่ขึ้นอะไรเลยเหมือนกันนะ ทั้งๆที่มันน่าจะขึ้น รายการสั่งซื้อ ทำไมมันขึ้นอะไรเลย หลายวันแล้วคะ ติดตรงนี้ 
Code (PHP) 
<?php 
if(!empty($_GET["MemberID"])){
    $MemberID=$_GET[MemberID];
    $sql_product = "select * from cusorder where MemberID = $MemberID order by MemberID desc";
//else{
    //$sql_product = "select * from cusorder order by MemberID desc";
//}
$dbquery_product = mysql_query($sql_product) or die(mysql_error()); 
//$num_rows_product = mysql_num_rows($dbquery_product);
while ($result= mysql_fetch_array($dbquery_product)){?>
    <a href="cusorder.php?MemberID=<?=$result["MemberID"];?>">รายการสั่งซื้อ</a><br>
<?php 
}} ?>
                        
               
               | 
             
            
              
			                              
                              
              
                
                     | 
                     | 
                     | 
                 
                
                     | 
                  
                      
                        | Date :
                            2013-05-06 18:05:36 | 
                        By :
                            NToo | 
                         
                    | 
                     | 
                 
                
                     | 
                     | 
                     | 
                 
                | 
             
           
			         | 
             | 
         
        
             | 
            | 
             | 
             | 
         
          
	    
     
               
		
     
		
	     
	    
     
               
		
     
		
	  
        
             | 
            | 
            | 
             | 
         
        
             | 
                       | 
          
            
               
                 แก้ไขตามที่บอกแล้วคะ ผลออกมาคือตามรูปคะ อีกอย่างขึ้นของคนอื่นด้วยคะ 
                         
               
               | 
             
            
              
			                              
                              
              
                
                     | 
                     | 
                     | 
                 
                
                     | 
                  
                      
                        | Date :
                            2013-05-06 19:26:37 | 
                        By :
                            NToo | 
                         
                    | 
                     | 
                 
                
                     | 
                     | 
                     | 
                 
                | 
             
           
			         | 
             | 
         
        
             | 
            | 
             | 
             | 
         
          
	    
     
               
		
     
		
	     
	    
     
               
		
     
		
	  
        
             | 
            | 
            | 
             | 
         
        
             | 
                       | 
          
            
               
                 คือหน้านี้ มันส่งการเล็อคอินเข้ามาคะ คือเมื่อเราล็อคอินเขามาก็จะสามรรถเข้าหน้าต่างๆได้ ถ้าต้องการให้เฉพาะสมาชิกเท่านั้นดูรายการสังซื้อได้คะ คือเมื่อล๊อกอิน a คุณ A ก็จะเห็นรายการสั่งซื้อของตัวเองทั้งนั้รคะ ไม่ทราบว่าต้องแก้อะไรยังไคะ โค๊ดเต็มๆนะคะ รบกวนหน่อยนะคะ  
Code (PHP) 
<meta http-equiv="Content-Type" content="text/html; charset=windows-874">
<?
//============ กรณีที่ทำการล็อกอินสมาชิก
if($_GET["action"]=="Login")
{
	//============ ตรวจสอบสมาชิก
	$resultLogin=select("member","where 1 and Email='".$_POST["txtEmailSC"]."' and Password='".$_POST["txtPassSC"]."' ");
	if(!$resultLogin)
	{
						echo "<script language=\"JavaScript\">";
						echo "alert('อีเมล์ และ รหัสผ่าน ไม่ถูกต้อง');";
						echo "</script>";
	}
	else
	{
				//============ บันทึกข้อมูลสมาชิก
					  $_SESSION["strEmail"]=$_POST["txtEmailSC"];
					  $_SESSION["strPassword"]=$_POST["txtPassSC"];
					  session_write_close();
					  header("location:product.php");	
	}
}
?>
<table width="168" height="22" border="0" align="center" cellpadding="0" cellspacing="0" id="Table_01">
  <tr> 
    <td width="8"> <img src="image/menu01.jpg" width="8" height="22" alt=""></td>
    <td width="151" background="image/menu02.jpg"><div align="center"><strong>เข้าสู่ระบบ</strong> 
      </div></td>
    <td width="9"> <img src="image/menu03.jpg" width="9" height="22" alt=""></td>
  </tr>
</table>
<table width="168" border="0" align="center" cellpadding="4" cellspacing="1" bgcolor="#66CC66">
  <tr>
    <td bgcolor="#FFFFFF"> 
      <?
	if($_SESSION["strEmail"] =="")
	{
	?>
      <table width="100%" height="75" border="0" cellspacing="0" bgcolor="#000000">
        <form action="?action=Login" method="post" name="frmLogin">
          <tr bgcolor="#FFFFFF"> 
            <td width="45%" class="style5 style45">อีเมล์ :            </td>
            <td width="55%"><input name="txtEmailSC" type="text" class="txtbox" id="txtEmailSC" size="15" /></td>
          </tr>
          <tr bgcolor="#FFFFFF"> 
            <td>รหัสผ่าน :</td>
            <td><input name="txtPassSC" type="password" class="txtbox" id="txtPassSC" size="15" />            </td>
          </tr>
          <tr bgcolor="#FFFFFF"> 
            <td height="26" colspan="2" align="center"><p> 
                <input name="submit" type="submit" class="button" value="เข้าสู่ระบบ" />
                <br>
                <img src="image/i-sticky.gif" width="13" height="16" border="0" align="absbottom"> 
                <a href="rule.php"> สมัครสมาชิก<br>
                </a><img src="image/i-sticky.gif" width="13" height="16" border="0" align="absbottom"> 
                <a href="forget.php"> ลืมรหัสผ่าน</a><br>
              </p>            </td>
          </tr>
        </form>
      </table>
      <?
	  }
	  else
	  {
	  ?>
      <table width="100%" height="75" border="0" cellspacing="0" bgcolor="#000000">
        <tr bgcolor="#FFFFFF"> 
          <td width="100%" colspan="2" class="style5 style45"><div align="center"><strong>ยินดีต้อนรับ</strong></div></td>
        </tr>
        <tr bgcolor="#FFFFFF"> 
          <td colspan="2" class="style5 style45"> <div align="center"> <strong> 
              <?
		  echo $_SESSION["strEmail"];
		  
		                  
	  //=========== แสดงสินค้า
			?>
		 
              </strong> </div></td>
        </tr>
        <tr bgcolor="#FFFFFF"> 
          <td colspan="2"><div align="center"><a href="profile.php">แก้ไขข้อมูลส่วนตัว</a><br />
              <a href="pass.php">เปลี่ยนรหัสผ่าน</a><br> 
<?php 
if(!empty($_GET["MemberID"])){
    $MemberID=$_GET[MemberID];
    $sql_product = "select * from cusorder where MemberID = $MemberID order by MemberID desc";
}else{
    $sql_product = "select * from cusorder order by MemberID desc";
}
$dbquery_product = mysql_query($sql_product);
//$num_rows_product = mysql_num_rows($dbquery_product);
while ($result= mysql_fetch_array($dbquery_product)){?>
    <a href="cusorder.php?MemberID=<?=$result["MemberID"];?>">     รายการสั่งซื้อ</a><br>
<?php 
} ?>
              <a href="logout.php"><font color="#FF0000">ออกจากระบบ</font></a></div></td>
        </tr>
      </table>
      <?
	  }
	  
	  ?>
      <div align="center"> <br>
        <img src="image/cart.gif" width="23" height="17" align="absmiddle"> <a href="cart.php"><a href="cart.php">สินค้าในตะกร้า</a><br />
        <br>
      </div></td>
  </tr>
</table>
<div align="center"><br />
  <table width="168" height="22" border="0" align="center" cellpadding="0" cellspacing="0" id="Table_01">
    <tr>
      <td width="8"><img src="image/menu01.jpg" width="8" height="22" alt="" /></td>
      <td width="151" background="image/menu02.jpg"><div align="center"><strong>ค้นหาสินค้า</strong></div></td>
      <td width="9"><img src="image/menu03.jpg" width="9" height="22" alt="" /></td>
    </tr>
  </table>
  <table width="168" border="0" align="center" cellpadding="4" cellspacing="1" bgcolor="#66CC66">
    <tr>
      <td bgcolor="#FFFFFF"><table width="100%" height="51" border="0" cellspacing="0" bgcolor="#000000">
          <form action="search.php" method="get" name="frmSearch" id="frmSearch">
            <tr>
              <td width="100%" height="25" bgcolor="#FFFFFF" class="style5 style45"><div align="center">
                  <input name="txtSearch" type="text" class="txtbox" id="txtSearch2" value="<?=$_GET["txtSearch"];?>" size="20" maxlength="35" />
              </div></td>
            </tr>
            <tr>
              <td height="26" align="center" bgcolor="#FFFFFF"><p align="center">
                  <input name="submit2" type="submit" class="button" id="submit" value="ค้นหา" />
              </p></td>
            </tr>
          </form>
      </table>
          <br />
      </td>
    </tr>
  </table>
  <br>
</div>
<table width="168" height="22" border="0" align="center" cellpadding="0" cellspacing="0" id="Table_01">
  <tr> 
    <td width="8"> <img src="image/menu01.jpg" width="8" height="22" alt=""></td>
    <td width="151" background="image/menu02.jpg"><div align="center"><span class="style3"><strong>ผู้ชมเว็บไซต์ทั้งหมด 
        </strong></span> </div></td>
    <td width="9"> <img src="image/menu03.jpg" width="9" height="22" alt=""></td>
  </tr>
</table>
<table width="168" border="0" align="center" cellpadding="4" cellspacing="1" bgcolor="#66CC66">
  <tr> 
    <td bgcolor="#FFFFFF"> 
      <div align="center"><br>
        <?
		  IF ($_SESSION["strStatus"] == "")
		  {
		  update("counter","COUNTER=COUNTER+1","where 1");
		  $_SESSION["strStatus"]="Yes";
		  session_write_close();
		  	}
			$result=select("counter","where 1=1");		  
			$counter = "$result[COUNTER]";
			for ($i = 0; $i < strlen($counter); $i++) {
			echo "<img src=\"image/$counter[$i].gif\" align=\"absbottom\">";			  
		  }
		  ?>
        <br>
        <br>
		
      </div></td>
  </tr>
</table>
<div align="center"><br>
  <strong> </strong><br>
  <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="130" height="140">
    <param name="movie" value="flash/clockcalendarwhite.swf" />
    <param name="quality" value="high" />
    <embed src="flash/clockcalendarwhite.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="130" height="140"></embed>
  </object>
  <br>
  <br>
  <strong>
  <?=date("d-m-Y H:i");?>
  </strong><br>
  <br>
</div>
<div align="center"><br>
  <br>
</div>
                        
               
               | 
             
            
              
			                              
                              
              
                
                     | 
                     | 
                     | 
                 
                
                     | 
                  
                      
                        | Date :
                            2013-05-06 19:47:22 | 
                        By :
                            NToo | 
                         
                    | 
                     | 
                 
                
                     | 
                     | 
                     | 
                 
                | 
             
           
			         | 
             | 
         
        
             | 
            | 
             | 
             | 
         
          
	    
     
               
		
     
		
	  
        
             | 
            | 
            | 
             | 
         
        
             | 
                       | 
          
            
               
                 จะเป็นแบบนี้คะ รูปแรกหน้าเล็อดอิน รูปที่สองเป็ฯรูปที่เหมือนล๊อดอินเข้าระบบคะ มันอยู่ในโค๊ดเดี๋ยวกันคะ 
  
                         
               
               | 
             
            
              
			                              
                              
              
                
                     | 
                     | 
                     | 
                 
                
                     | 
                  
                      
                        | Date :
                            2013-05-06 19:51:49 | 
                        By :
                            NToo | 
                         
                    | 
                     | 
                 
                
                     | 
                     | 
                     | 
                 
                | 
             
           
			         | 
             | 
         
        
             | 
            | 
             | 
             | 
         
          
	    
     
               
		
     
		
	     
	    
     
               
		
     
		
	  
        
             | 
            | 
            | 
             | 
         
        
             | 
                       | 
          
            
               
                 พี่คะ  ต้องไปส่งพรุ่งนี้ แล้วคะ รบกวนพี่ได้คะ ขอร้องจริงๆๆๆๆๆ TT_TT                        
               
               | 
             
            
              
			                              
                              
              
                
                     | 
                     | 
                     | 
                 
                
                     | 
                  
                      
                        | Date :
                            2013-05-06 20:04:49 | 
                        By :
                            NToo | 
                         
                    | 
                     | 
                 
                
                     | 
                     | 
                     | 
                 
                | 
             
           
			         | 
             | 
         
        
             | 
            | 
             | 
             | 
         
          
	    
     
               
		
     
		
	  
        
             | 
            | 
            | 
             | 
         
        
             | 
                       | 
          
            
               
                 แนะนำให้ไม่ต้องลูปอะไรทั้งนั้นครับ สำหรับลิงค์แสดงรายการสั่งสินค้า เอาแค่ลิงค์ไปที่หน้า cusorder.php แล้วในนั้น ก็ใช้ session ของคนทีล็อกอินมานะ มาคิวรี่หา order ของเขา โดยการล็อกอินต้องเก็บ member_id ลง session ไปด้วย แค่นั้นเพียงพอครับ                        
               
               | 
             
            
              
			                              
                              
              
                
                     | 
                     | 
                     | 
                 
                
                     | 
                  
                      
                        | Date :
                            2013-05-06 20:06:00 | 
                        By :
                            ikikkok | 
                         
                    | 
                     | 
                 
                
                     | 
                     | 
                     | 
                 
                | 
             
           
			         | 
             | 
         
        
             | 
            | 
             | 
             | 
         
          
	    
     
               
		
     
		
	  
        
             | 
            | 
            | 
             | 
         
        
             | 
                       | 
          
            
               
                 แบบไหนคะ พี่PlaKriM มีอาการงงเล็กน้อย แล้วหน้าcusorder.php แก้ตรงไหน ผู้น้อยเริ่มงง แล้วคะ อันนี้โคีดหน้า cusorder.php 
Code (PHP) 
<?
ob_start();
session_start();
//============ Start Session และทำการเรียก Function ติดต่อฐานข้อมูล 
require_once('connect/connect.php');
require("connect/function.php");
$resultUser=select("member","where 1 and Email='".$_SESSION["strEmail"]."' ");
if(!$resultUser)
{
header("location:logout.php");
}
//=========== ถ้ามีการลบรายการสินค้า
						if($_GET["Action"]=="Delete")
						{
							//===========  ลบตาราง cusorder หมายเลขใบสั่งซื้อ
							$sql_del= "delete from cusorder  where OrderNo='".$_GET["OrderNo"]."'";
							$dbquery_del = mysql_query($sql_del);
							//===========  ลบรายละเอียดว่าได้สั่งซื้อะไรบ้าง
							$sql_del= "delete from order_detail  where OrderNo='".$_GET["OrderNo"]."'";
							$dbquery_del = mysql_query($sql_del);							
									echo"<script language='JavaScript'>";
									echo"alert('ลบข้อมูลเรียบร้อยแล้ว');";
									echo"window.location='cusorder.php';";
									echo"</script>";							
						}
						
?>
<meta http-equiv="Content-Type" content="text/html; charset=windows-874">
<title></title>
<link rel="stylesheet" href="css/styles.css" type="text/css">
<script language="JavaScript" src="editor.js"></script>
<div align="center"><br>
<body topmargin="0">
<table width="778" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#FFFFFF">
  <tr> 
    <td bgcolor="#FFFFFF"> <table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr> 
          <td> 
            <?php require_once('head.php'); ?>
          </td>
        </tr>
        <tr> 
          <td><table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="#f2f2f6" bgcolor="#FFFFFF">
              <tr> 
                <td width="20%" valign="top"> 
                  <?php require_once('menuleft.php'); ?>                </td>
                <td width="80%" valign="top">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
                    <!--DWLayoutTable-->
                    <tr> 
                      <td width="200" height="310" valign="top"><div align="center"><br>
                            <table cellspacing=1 cellpadding=4 width="75%" bgcolor=#CCCCCC border=0 align="center" height="10">
                              <tbody>
                                <tr bgcolor=#e5e5e5>
                                  <td width="100%" bgcolor="#FFFFFF"><div align="center"></div>
                                      <table cellspacing=1 cellpadding=4 width="100%" border=0 align="center" height="10">
                                        <tbody>
                                          <tr bgcolor=#e5e5e5>
                                            <td width="35%" bgcolor="#FFFFFF"><div align="left"><b><img src="../image/allrowto.gif" width="11" height="11" align="absbottom"> รายการสั่งซื้อ</b></div></td>
                                            <td width="22%" align=middle bgcolor="#FFFFFF"><div align="left"> </div></td>
                                            <td width="43%" bgcolor="#FFFFFF"><div align="right"><a href="head.php"></a></div></td>
                                          </tr>
                                        </tbody>
                                    </table></td>
                                </tr>
                              </tbody>
                            </table>
                      </div>
                        <table width="68%" border="0" align="center" cellpadding="0" cellspacing="0">
                          <tr>
                            <td width="58%"> </td>
                            <td width="42%"> </td>
                          </tr>
                        </table>
                        <table cellspacing=1 cellpadding=3 width="75%" bgcolor=#CCCCCC border=0 align="center" height="10">
                          <tbody>
                            <tr bgcolor=#e5e5e5>
                              <td bgcolor="#FFFFFF"><div align="center">รหัสสั่งซื้อ</div></td>
                              <td bgcolor="#FFFFFF">ชื่อ</td>
                              <td bgcolor="#FFFFFF"><div align="center">สถานะ</div></td>
                              <td bgcolor="#FFFFFF"><div align="center">วันที่</div></td>
                            </tr>
                            <?
	 		 $i=0;
		//===========  นำข้อมูลมาแสดงทั้งหมด
$sql = "select * From cusorder where 1=1 and MemberID='".$_GET["MemberID"]."'";
/*   ตั้งค่า แสดงผลต่อหน้า  $Per_Page   */
$Per_Page =10;
if(!$Page)
$Page=1;
$Prev_Page = $Page-1;
$Next_Page   = $Page+1;
$result  = mysql_query($sql);
$Page_start = ($Per_Page*$Page)-$Per_Page;
$Num_Rows =	mysql_num_rows($result);
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;
if(($Page>$Num_Pages)	|| ($Page<0))
print "<center><b>จำนวน $Page มากกว่า $Num_Pages ยังไม่มีข้อความ<b></center>";
$sql .= " order by MemberID desc   LIMIT $Page_start , $Per_Page";
  //ส่วนแสดงผล
  $i=0;
		$query =  mysql_query($sql);
		While($result= mysql_fetch_array($query)){
$i++;
$resultMember=select("member","where 1=1 and MemberID='".$result["MemberID"]."'");			
			?>
                            <tr bgcolor=#e5e5e5>
                              <td width="132" bgcolor="#FFFFFF"><div align="center"> <a href="orderdetail.php?OrderNo=<?=$result["OrderNo"];?>">
                                  <?=$result["OrderNo"];?>
                              </a></div></td>
                              <td width="198" bgcolor="#FFFFFF">
                                <?=$resultMember["Name"];?>
                                <?=$resultMember["LastName"];?>
                              </a></td>
                              <td width="183" bgcolor="#FFFFFF"><div align="center">
                                  <?
		  if($result["status"]=="1")
		  {
		  echo "รอการชำระเงิน";
		  }
		  else
		  {
		  echo "ชำระเงิน/จัดส่งสินค้าไปแล้ว";
		  }
		  ?>
                              </div></td>
                              <td width="150" bgcolor="#FFFFFF"><div align="center">
                                  <?=$result["Date"];?>
                              </div></td>
                              <script language="JavaScript">
function Conf<?=$i; ?>(object) {
if (confirm("ยืนยันการลบ [  <?=$result["OrderNo"]; ?> ] ") ==true) {
return true;
}
return false;
}
                        </script>
                            </tr>
                            <?
}
?>
                          </tbody>
                        </table>
                        <br>
                        <br>
                        <table width="75%" border="0" align="center" cellpadding="0" cellspacing="0">
                          <tr>
                            <td> จำนวน
                              <?= $Num_Rows;?>
                              </b> แบ่งเป็น : <b>
                                <?=$Num_Pages;?>
                                </b> ไปยัง :
                              <?/* สร้างปุ่มย้อนกลับ */
			if($Prev_Page)	
					echo " <a href='$PHP_SELF?Page=$Prev_Page'><< Back </a> ";
			for($i=1; $i<$Num_Pages; $i++){
						if($i != $Page)
								echo " [ <a href='$PHP_SELF?Page=$i'>$i</a> ]";
						else 
								echo "<b> $i </b>";
		}
/*สร้างปุ่มเดินหน้า */
if($Page!=$Num_Pages)
					echo " <a href ='$PHP_SELF?Page=$Next_Page'> Next >>  </a>";
			
			?>
                              </font>  </td>
                          </tr>
                        </table></td>
                    </tr>
                </table></td>
              </tr>
              <tr> 
                <td colspan="2" valign="top">
                  <?php require_once('down.php'); ?>                </td>
              </tr>
            </table></td>
        </tr>
      </table></td>
  </tr>
</table>
</body>
</html>
                        
               
               | 
             
            
              
			                              
                              
              
                
                     | 
                     | 
                     | 
                 
                
                     | 
                  
                      
                        | Date :
                            2013-05-06 20:09:17 | 
                        By :
                            NToo | 
                         
                    | 
                     | 
                 
                
                     | 
                     | 
                     | 
                 
                | 
             
           
			         | 
             | 
         
        
             | 
            | 
             | 
             | 
         
          
	    
     
               
		
     
		
	  
        
             | 
            | 
            | 
             | 
         
        
             | 
                       | 
          
            
               
                 ตรง $_GET["MemberID"] หันไปใช้ $_SESSION["Member_ID"] แทนครับ 
 
โดยอย่างที่บอกเวลาล็อกอินให้เก็บ $_SESSION["MemberID"] ด้วย                        
               
               | 
             
            
              
			                              
                              
              
                
                     | 
                     | 
                     | 
                 
                
                     | 
                  
                      
                        | Date :
                            2013-05-06 20:12:30 | 
                        By :
                            ikikkok | 
                         
                    | 
                     | 
                 
                
                     | 
                     | 
                     | 
                 
                | 
             
           
			         | 
             | 
         
        
             | 
            | 
             | 
             | 
         
          
	    
     
               
		
     
		
	  
        
             | 
            | 
            | 
             | 
         
        
             | 
                       | 
          
            
               
                 หน้าไหนคะ หน้า cusorder.php หรือป่าวคะ หรืออีกหน้าหนึ่งคะ แล้วแก้บรรทัดที่เท่าไรคะ                        
               
               | 
             
            
              
			                              
                              
              
                
                     | 
                     | 
                     | 
                 
                
                     | 
                  
                      
                        | Date :
                            2013-05-06 20:19:21 | 
                        By :
                            NToo | 
                         
                    | 
                     | 
                 
                
                     | 
                     | 
                     | 
                 
                | 
             
           
			         | 
             | 
         
        
             | 
            | 
             | 
             | 
         
          
	    
     
               
		
     
		
	  
        
             | 
            | 
            | 
             | 
         
        
             | 
                       | 
          
            
               
                 ช่วยด้วยคะพี่ๆ                        
               
               | 
             
            
              
			                              
                              
              
                
                     | 
                     | 
                     | 
                 
                
                     | 
                  
                      
                        | Date :
                            2013-05-06 22:39:00 | 
                        By :
                            NToo | 
                         
                    | 
                     | 
                 
                
                     | 
                     | 
                     | 
                 
                | 
             
           
			         | 
             | 
         
        
             | 
            | 
             | 
             | 
         
          
	    
     
               
		
     
		
	  
        
             | 
            | 
            | 
             | 
         
        
             | 
                       | 
          
            
               
                 พี่คะ ลองเขียนแบบใหม่ แล้วลอง echo ค่ออกมา 
มันขึ้นว่า select * from cusorder where MemberID = '' order by MemberID desc ตรงMemberID = '' มันไม่ส่งค่ามาคะทำไงดีคะ งงหมดแล้วคะ 
ด๕ีดเปลี่ยนล่าสุด 
Code (PHP) 
<meta http-equiv="Content-Type" content="text/html; charset=windows-874">
<?
//============ กรณีที่ทำการล็อกอินสมาชิก
if($_GET["action"]=="Login")
{
	//============ ตรวจสอบสมาชิก
	$sql=mysql_query("select * from member where Email='".$_POST["txtEmailSC"]."' and Password='".$_POST["txtPassSC"]."' ");
  $resultLogin=mysql_fetch_array($sql);
	if(count($resultLogin)<1)
	{
						echo "<script language=\"JavaScript\">";
						echo "alert('อีเมล์ และ รหัสผ่าน ไม่ถูกต้อง');";
						echo "</script>";
	}
	else
	{
				//============ บันทึกข้อมูลสมาชิก
					  $_SESSION["strEmail"]=$_POST["txtEmailSC"];
					  $_SESSION["strPassword"]=$_POST["txtPassSC"];
					  session_write_close();
					  header("location:product.php");	
	}
}
?>
<table width="168" height="22" border="0" align="center" cellpadding="0" cellspacing="0" id="Table_01">
  <tr> 
    <td width="8"> <img src="image/menu01.jpg" width="8" height="22" alt=""></td>
    <td width="151" background="image/menu02.jpg"><div align="center"><strong>เข้าสู่ระบบ</strong> 
      </div></td>
    <td width="9"> <img src="image/menu03.jpg" width="9" height="22" alt=""></td>
  </tr>
</table>
<table width="168" border="0" align="center" cellpadding="4" cellspacing="1" bgcolor="#66CC66">
  <tr>
    <td bgcolor="#FFFFFF"> 
      <?
	if($_SESSION["strEmail"] =="")
	{
	?>
      <table width="100%" height="75" border="0" cellspacing="0" bgcolor="#000000">
        <form action="?action=Login" method="post" name="frmLogin">
          <tr bgcolor="#FFFFFF"> 
            <td width="45%" class="style5 style45">อีเมล์ :            </td>
            <td width="55%"><input name="txtEmailSC" type="text" class="txtbox" id="txtEmailSC" size="15" /></td>
          </tr>
          <tr bgcolor="#FFFFFF"> 
            <td>รหัสผ่าน :</td>
            <td><input name="txtPassSC" type="password" class="txtbox" id="txtPassSC" size="15" />            </td>
          </tr>
          <tr bgcolor="#FFFFFF"> 
            <td height="26" colspan="2" align="center"><p> 
                <input name="submit" type="submit" class="button" value="เข้าสู่ระบบ" />
                <br>
                <img src="image/i-sticky.gif" width="13" height="16" border="0" align="absbottom"> 
                <a href="rule.php"> สมัครสมาชิก<br>
                </a><img src="image/i-sticky.gif" width="13" height="16" border="0" align="absbottom"> 
                <a href="forget.php"> ลืมรหัสผ่าน</a><br>
              </p>            </td>
          </tr>
        </form>
      </table>
      <?
	  }
	  else
	  {
	  ?>
      <table width="100%" height="75" border="0" cellspacing="0" bgcolor="#000000">
        <tr bgcolor="#FFFFFF"> 
          <td width="100%" colspan="2" class="style5 style45"><div align="center"><strong>ยินดีต้อนรับ</strong></div></td>
        </tr>
        <tr bgcolor="#FFFFFF"> 
          <td colspan="2" class="style5 style45"> <div align="center"> <strong> 
		  
              <?
		  echo $_SESSION["strEmail"];
		  
		                  ?>
						     <p><a href="profile.php">แก้ไขข้อมูลส่วนตัว</a><br />
              <a href="pass.php">เปลี่ยนรหัสผ่าน<br />
						  <?
	  //=========== แสดงสินค้า
  $MemberID = $resultLogin["MemberID"]; 
	  	/*$condition="";
	  		if($_GET["MemberID"] <> "")
			{
			$condition="and MemberID='$_GET[MemberID]' ";
			}*/
	 		 //$i=0;
			 //=========== ทำการ query เพื่อเลือกรายการสินค้า
		echo	$sql_product = "select * from cusorder where MemberID = '$MemberID' order by MemberID desc";
			$dbquery_product = mysql_query($sql_product);
			$num_rows_product = mysql_num_rows($dbquery_product);
			while ($result= mysql_fetch_array($dbquery_product))
			{
			//$i++;
			?>
		 
              </strong> </div></td>
        </tr>
        <tr bgcolor="#FFFFFF"> 
          <td colspan="2"><div align="center">
              </a><a href="cusorder.php?MemberID=<?=$result["MemberID"];?>">รายการสั่งซื้อ <? } ?>
              <a href="logout.php"><font color="#FF0000">ออกจากระบบ</font></a></p>
            </div></td>
        </tr>
      </table>
      <?
	  }
	  
	  ?>
      <div align="center"> <br>
        <img src="image/cart.gif" width="23" height="17" align="absmiddle"> <a href="cart.php">สินค้าในตะกร้า<br />
        </a><br>
        <br>
      </div></td>
  </tr>
</table>
<div align="center"><br />
  <table width="168" height="22" border="0" align="center" cellpadding="0" cellspacing="0" id="Table_01">
    <tr>
      <td width="8"><img src="image/menu01.jpg" width="8" height="22" alt="" /></td>
      <td width="151" background="image/menu02.jpg"><div align="center"><strong>ค้นหาสินค้า</strong></div></td>
      <td width="9"><img src="image/menu03.jpg" width="9" height="22" alt="" /></td>
    </tr>
  </table>
  <table width="168" border="0" align="center" cellpadding="4" cellspacing="1" bgcolor="#66CC66">
    <tr>
      <td bgcolor="#FFFFFF"><table width="100%" height="51" border="0" cellspacing="0" bgcolor="#000000">
          <form action="search.php" method="get" name="frmSearch" id="frmSearch">
            <tr>
              <td width="100%" height="25" bgcolor="#FFFFFF" class="style5 style45"><div align="center">
                  <input name="txtSearch" type="text" class="txtbox" id="txtSearch2" value="<?=$_GET["txtSearch"];?>" size="20" maxlength="35" />
              </div></td>
            </tr>
            <tr>
              <td height="26" align="center" bgcolor="#FFFFFF"><p align="center">
                  <input name="submit2" type="submit" class="button" id="submit" value="ค้นหา" />
              </p></td>
            </tr>
          </form>
      </table>
          <br />
      </td>
    </tr>
  </table>
  <br>
</div>
<table width="168" height="22" border="0" align="center" cellpadding="0" cellspacing="0" id="Table_01">
  <tr> 
    <td width="8"> <img src="image/menu01.jpg" width="8" height="22" alt=""></td>
    <td width="151" background="image/menu02.jpg"><div align="center"><span class="style3"><strong>ผู้ชมเว็บไซต์ทั้งหมด 
        </strong></span> </div></td>
    <td width="9"> <img src="image/menu03.jpg" width="9" height="22" alt=""></td>
  </tr>
</table>
<table width="168" border="0" align="center" cellpadding="4" cellspacing="1" bgcolor="#66CC66">
  <tr> 
    <td bgcolor="#FFFFFF"> 
      <div align="center"><br>
        <?
		  IF ($_SESSION["strStatus"] == "")
		  {
		  update("counter","COUNTER=COUNTER+1","where 1");
		  $_SESSION["strStatus"]="Yes";
		  session_write_close();
		  	}
			$result=select("counter","where 1=1");		  
			$counter = "$result[COUNTER]";
			for ($i = 0; $i < strlen($counter); $i++) {
			echo "<img src=\"image/$counter[$i].gif\" align=\"absbottom\">";			  
		  }
		  ?>
        <br>
        <br>
		
      </div></td>
  </tr>
</table>
<div align="center"><br>
  <strong> </strong><br>
  <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="130" height="140">
    <param name="movie" value="flash/clockcalendarwhite.swf" />
    <param name="quality" value="high" />
    <embed src="flash/clockcalendarwhite.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="130" height="140"></embed>
  </object>
  <br>
  <br>
  <strong>
  <?=date("d-m-Y H:i");?>
  </strong><br>
  <br>
</div>
<div align="center"><br>
  <br>
</div>
                        
               
               | 
             
            
              
			                              
                              
              
                
                     | 
                     | 
                     | 
                 
                
                     | 
                  
                      
                        | Date :
                            2013-05-07 00:25:08 | 
                        By :
                            NToo | 
                         
                    | 
                     | 
                 
                
                     | 
                     | 
                     | 
                 
                | 
             
           
			         | 
             | 
         
        
             | 
            | 
             | 
             | 
         
          
	    
     
               
		
     
		
	  
        
             | 
            | 
            | 
             | 
         
        
             | 
                       | 
          
            
               
                 ช่วยหน่อยคะ                        
               
               | 
             
            
              
			                              
                              
              
                
                     | 
                     | 
                     | 
                 
                
                     | 
                  
                      
                        | Date :
                            2013-05-07 09:17:53 | 
                        By :
                            NToo | 
                         
                    | 
                     | 
                 
                
                     | 
                     | 
                     | 
                 
                | 
             
           
			         | 
             | 
         
        
             | 
            | 
             | 
             | 
         
          
	    
     
      		  
	
     | 
   
 
                 |