Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,027

HOME > PHP > PHP Forum > สอบถามวิธีการแสดงผลตารางแบบเป็น Group จะต้องใช้อย่างไร



 

สอบถามวิธีการแสดงผลตารางแบบเป็น Group จะต้องใช้อย่างไร

 



Topic : 103060



โพสกระทู้ ( 2 )
บทความ ( 0 )



สถานะออฟไลน์




ตอนแรกแสดงผลตารางอกกมาแบบนี้ครับ
before

อันนี้ตาราง
table

อันนี้ code ครับ
Code (PHP)
  <tr>
  <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr bgcolor="#D74B4B"> 
                <td width="24%"> <div align="center"><font color="#000000" size="3"><strong>การแข่งขัน</strong></font></div></td>
                <td width="9%"> <div align="center"><font color="#000000" size="3"><strong>เวลา</strong></font></div></td>
                <td width="30%" height="29"><div align="center"><font color="#000000" size="3"><strong>คู่แข่งขัน</strong></font></div></td>
                <td width="14%"><div align="center"><font color="#000000" size="3"><strong>ราคา</strong></font></div></td>
                <td width="14%"><div align="center"><font color="#000000" size="3"><strong>ฟันธง</strong></font></div></td>
                <!--<td width="13%"> <div align="center"><font color="#000000" size="3"><strong>คำเล่นลิ้น</strong></font></div></td>-->
                <td width="9%"><div align="center"><font color="#000000" size="3"><strong>ผล</strong></font></div></td>
              </tr>
            </table>
            <?
$page = $_GET['page'];

$select_type="select * from tdedboard  order by id desc";
$query_select=mysql_query($select_type);
$num_rows=mysql_num_rows($query_select);

if($num_rows<1){
echo "<br><br><center><font color=#666666 face=tahoma size=2><b>ยังไม่มีการเพิ่มข้อมูลค่ะ</b></font></center>";
}else{
		$select="select * from tdedboard order by id desc";
		$q_ry = mysql_query($select);
	 	$num_rows=mysql_num_rows($q_ry);
  		$pagesize=30;
		$rt=$num_rows%$pagesize;
		if($rt!=0)
			{
				$totalpage=floor($num_rows/$pagesize)+1;
			}
		else
			{
				$totalpage=floor($num_rows/$pagesize);
				$toppic_id=1;
			}
		if(empty($page))
			{
				$page=1;
			}
		mysql_free_result($q_ry);
		$goto=($page-1)*$pagesize;
$sql_select_mem="Select * From tdedboard  where datep='2013-11-12'  limit $goto,$pagesize";
		$fect=mysql_query($sql_select_mem);
		if(!$fect)
		{
		("ติดต่อฐานข้อมูลไม่ได้".mysql_error());
		exit;
		}

	  $bgcount=0;
	while($rows=mysql_fetch_array($fect))
	{
$idp =$rows['id'];
$leaugeid  =$rows['leaugeid'];
$datep = $rows['datep'];
$timep = $rows['timep'];
$team1 = $rows['team1'];
$team1ok = $rows['team1ok'];
$team2 = $rows['team2'];
$team2ok = $rows['team2ok'];
$priceok = $rows['priceok'];
$tdedprice = $rows['tdedprice'];
$tded = $rows['tded'];
$wordtded = $rows['wordtded'];
$score = $rows['score'];

$sqll="select * from leauge where id='$leaugeid'";
						  $db_query=mysql_db_query($db,$sqll);
						  $resultl=mysql_fetch_array($db_query);
						  $leaugename=$resultl[leaugename];
	?>
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td bgcolor="#DCDDD8"><table width="100%" border="0" cellspacing="1" cellpadding="1">
					<tr>
					<td>
					<? echo "$leaugename"; ?>
					</td>
					</tr>
                    <tr bgcolor="#354B5E"> 
                      <td width="24%" height="51"> <div align="center"><font color="#ffffff" size="2"> 
                          <? echo "$datep"; ?>
                          </font></div></td>
                      <td width="9%"><div align="center"><font color="#ffffff" size="2"> 
                          <? echo "$timep"; ?>
                          </font></div></td>
                      <td width="30%"><div align="center"> 
                          <?
							  if ($team1ok == "99999")
							  {
							  echo "<font size=2 color=#D74B4B>$team1</font>";
							  }else if ($team1ok == "00000")
							  {
							  echo "<font size=2 color=#ffffff>$team1</font>";
							  }
							  ?>
                          <font size="2" color="#ffffff"> VS. </font> 
                          <?
							  if ($team2ok == "99999")
							  {
							  echo "<font size=2 color=#D74B4B>$team2</font>";
							  }else if ($team2ok == "00000")
							  {
							  echo "<font size=2 color=#ffffff>$team2</font>";
							  }
							  ?>
                          </a><br />
                          <font color="#ffffff" size="2"> 
                          <? echo "$priceok"; ?>
                          </font></div></td>
                      <td width="14%"><div align="center"><font color="#ffffff" size="2"> 
                          <? echo "$tdedprice"; ?>
                          </font></div></td>
                      <td width="14%" bgcolor="#354B5E"> <div align="center"><font color="#ffffff" size="2"> 
                          <? echo "$tded"; ?>
                          </font></div></td>
                      <!--<td width="13%"> <div align="center"><font color="#ffffff" size="2"> 
                          <? echo "$wordtded"; ?>-->
                          </font></div></td>
                      <td width="9%"><div align="center"> <font size="2"> 
                          <?
							  if ($score == "win")
							  {
							   echo "<font size=2 color=#00CC33>WIN</font>"; 
							   }else if ($score == "loss"){
							   echo "<font size=2 color=#afafaf>LOSS</font>";
							   }else{
							   echo "";
							   }
							   ?>
                          </font></div></td>
                    </tr>
                  </table></td>
              </tr>
            </table>
            <?
}
}
?>
          </td>
        </tr> 


---
แต่ผมอยากให้มันแสดงผลออกมาเป็นแบบรูปด้านล่างครับ ต้องเขียน code ยังไงครับ
after

รบกวนช่วยหน่อยครับ ลองมาหลายวันแล้ว ยังไม่ได้เลย
ขอบคุณคร้าบ



Tag : PHP, MySQL, HTML/CSS, Windows







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2013-11-25 22:44:44 By : neodox View : 780 Reply : 2
 

 

No. 1



โพสกระทู้ ( 1,569 )
บทความ ( 2 )



สถานะออฟไลน์
Twitter Facebook Blogger

จาก
Code (PHP)
$bgcount=0;
.
.
.
<tr>
<td>
<? echo "$leaugename"; ?>
</td>
</tr>

เป็น
Code (PHP)
$bgcount=0; $recentLeague = '';
.
.
.
<?php if($leaugename!=$recentLeague){ ?>
<tr>
<td>
<?php echo "$leaugename"; $recentLeague = $leaugename; ?>
</td>
</tr>







แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-11-25 22:56:07 By : itpcc
 


 

No. 2



โพสกระทู้ ( 2 )
บทความ ( 0 )



สถานะออฟไลน์


ตก } ไปตัวนึง แต่ทำได้แล้วครับ ขอบคุณมากๆ คร้าบ

Code (PHP)
$bgcount=0; $recentLeague = '';
.
.
.
<?php if($leaugename!=$recentLeague){ ?>
<tr>
<td>
<?php echo "$leaugename"; $recentLeague = $leaugename; } ?>
</td>
</tr>

แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-11-25 23:14:26 By : neodox
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : สอบถามวิธีการแสดงผลตารางแบบเป็น Group จะต้องใช้อย่างไร
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ FTP| ใส่แถวของตาราง ใส่คอลัมน์ตาราง| ตัวยก ตัวห้อย ตัวพิมพ์ดีด| ใส่โค้ด ใส่การอ้างถึงคำพูด| ใส่ลีสต์
smiley for :lol: smiley for :ken: smiley for :D smiley for :) smiley for ;) smiley for :eek: smiley for :geek: smiley for :roll: smiley for :erm: smiley for :cool: smiley for :blank: smiley for :idea: smiley for :ehh: smiley for :aargh: smiley for :evil:
Insert PHP Code
Insert ASP Code
Insert VB.NET Code Insert C#.NET Code Insert JavaScript Code Insert C#.NET Code
Insert Java Code
Insert Android Code
Insert Objective-C Code
Insert XML Code
Insert SQL Code
Insert Code
เพื่อความเรียบร้อยของข้อความ ควรจัดรูปแบบให้พอดีกับขนาดของหน้าจอ เพื่อง่ายต่อการอ่านและสบายตา และตรวจสอบภาษาไทยให้ถูกต้อง

อัพโหลดแทรกรูปภาพ

Notice

เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ
อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง

   
  เพื่อความปลอดภัยและการตรวจสอบ กระทู้ที่แทรกไฟล์อัพโหลดไฟล์จากที่อื่น อาจจะถูกลบทิ้ง
 
โดย
อีเมล์
บวกค่าให้ถูก
<= ตัวเลขฮินดูอารบิก เช่น 123 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)







Exchange: นำเข้าสินค้าจากจีน, Taobao, เฟอร์นิเจอร์, ของพรีเมี่ยม, ร่ม, ปากกา, power bank, แฟลชไดร์ฟ, กระบอกน้ำ

Load balance : Server 01
ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2024 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่