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 > อยากดึงข้อมูลหน่วยงานที่อยู่อีกตารางขึ้นมาแสดงที่อยู่คนละตารางขึ้นมาแสดงค่ะ แต่มันไม่แสดงแต่ข้อความหน่วยงานขึ้นมาค่ะ โค้ดพอจะถูกมั้ยค่ะ หรือให้แก้ส่วนไหนกรุณาแนะนำหน่อยค่ะ



 

อยากดึงข้อมูลหน่วยงานที่อยู่อีกตารางขึ้นมาแสดงที่อยู่คนละตารางขึ้นมาแสดงค่ะ แต่มันไม่แสดงแต่ข้อความหน่วยงานขึ้นมาค่ะ โค้ดพอจะถูกมั้ยค่ะ หรือให้แก้ส่วนไหนกรุณาแนะนำหน่อยค่ะ

 



Topic : 057265



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



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




อยากดึงข้อมูลหน่วยงานที่อยู่อีกตารางขึ้นมาแสดง<ตาราง หน่วยงาน มี Agencies_ID และ AgenciesName>ที่อยู่คนละตารางขึ้นมาแสดงค่ะ แต่มันไม่แสดงแต่ข้อความหน่วยงานขึ้นมาค่ะ โค้ดพอจะถูกมั้ยค่ะ หรือให้แก้ส่วนไหนกรุณาแนะนำหน่อยค่ะ
โค้ดแสดงข้อมูลค่ะ
Code (PHP)
<? session_start();
include("connect.php"); ?>


<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<link href="style.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
body {
	background-color: #D5FFD5;
}
.style11 {color: #000000}
.style13 {color: #000000; font-weight: bold; }
.style20 {font-size: 12px}
.style22 {
	font-size: 12px;
	font-family: tahoma;
	color: #009933;
}
.style23 {color: #000000; font-family: tahoma; }
.style24 {font-family: tahoma}
.style25 {
	font-size: 12;
	font-family: Tahoma;
}
a {
	font-size: 12px;
	font-family: Tahoma;
}
a:link {
	color: #000000;
}
a:visited {
	color: #000000;
}
a:hover {
	color: #FF0000;
}
a:active {
	color: #CC3300;
}
-->
</style>
</head>

<body>
<? /* if(!$_SESSION["id"]){
	 ?>
     <script language="Javascript">
    	alert ("กรุณาทำการล็อกอินเข้าสู่ระบบก่อน");
	 </script>
     <?
	 echo "<meta http-equiv='refresh'content='0; url=login_employee.php'>";
	exit(0);} */
?>


<table width="915" height="150
" border="0" align="center" background="images/head.jpg">
  <tr>
    <th width="450" height="150" scope="col">&nbsp;</th>
  </tr>
</table><br>

<table width="915" height="350" border="0" align="center" bordercolor="#FFFFFF" bgcolor="#FFFFFF">
  <tr>
    <th height="28" colspan="2" align="left" valign="top" bgcolor="#97FF97" scope="col"><table width="859" height="37" border="0" align="center" bordercolor="#97FF97" bgcolor="#97FF97">
      <tr>
        <th width="905" height="18" align="center" bgcolor="#97FF97" scope="col"><span class="font">
		<a href="main.php">แจ้งขอใช้บริการ</a>|		
		<a href=".php">ค้นหา/ยกเลิก</a> |
		<a href="list_applicant.php">ข้อมูลส่วนตัว</a>   |  		    
		<a href="logout.php">ออกจากระบบ</a></span> </th>
      </tr>
    </table>
	  <p></p>
	<p></p>
	<p> </p>
	
	<div align="right"></div>
           <div align="right"></div>
<div align="right"></div></th>
    </tr>
  <tr>
    <th width="128" height="386" align="left" valign="top" bgcolor="#FFFFFF" scope="col"> </th>
    <th width="777" align="left" valign="top" bgcolor="#FFFFFF" class="font4" scope="col"><div align="right"><span class="font">ยินดีต้อนรับคุณ	</span>
	<span class="font3"><? echo $_SESSION["App_Fname"]; ?>&nbsp;&nbsp;</span> <img src="images/friend.gif" width="24" height="24" align="absmiddle" />&nbsp;&nbsp;</div>
 
    <br>
	<div align="right"class="font">วันที่ 
	<span class="font3"><?php   
$_month_name = array("01"=>"มกราคม",  "02"=>"กุมภาพันธ์",  "03"=>"มีนาคม",         
"04"=>"เมษายน",  "05"=>"พฤษภาคม",  "06"=>"มิถุนายน",       
"07"=>"กรกฎาคม",  "08"=>"สิงหาคม",  "09"=>"กันยายน",        
"10"=>"ตุลาคม", "11"=>"พฤศจิกายน",  "12"=>"ธันวาคม");  
$vardate=date('Y-m-d'); 
$yy=date('Y'); 
$mm =date('m');$dd=date('d');  
if ($dd<10){  
$dd=substr($dd,1,2); 
} 
$date=$dd ." ".$_month_name[$mm]."  ".$yy+= 543; 
echo $date; 
?></span>&nbsp;</div>
	 <img src="../project1/images/em.gif" width="25" height="20" />ข้อมูลส่วนตัว
	<table width="688" height="322" border="0" style="border:solid 1px; color:#999999;">
  <tr>
    <th width="682" height="316" valign="top" scope="col">
	     <? 
	  if($_GET["idapp"] == "") {
		$id = $_SESSION["appid"];
		$sql = " select * from applicant where App_ID = '$id' ";
	  }else {
	  	$idapp = $_GET["idapp"];
		$sql = " select applicant.App_ID,(select AgenciesName from agencies where applicant.Agencies_ID = agencies.Agencies_ID), applicant.App_Fname
		from applicant INNER JOIN agencies ON applicant.Agencies_ID = agencies.Agencies_ID where App_ID = '$idapp' ";
		 //from applicant where App_ID = '$idapp' ";
	  //  $rs_agencies =mysql_query (" SELECT * FROM agencies ORDER BY AgenciesName DES");
	  }
	$result = mysql_query($sql);
	while($row = mysql_fetch_array($result)) {
	//mysql_close($connect);

?>
	<table width="623" height="259" border="0" align="center">
      <tr>
        <th width="203" height="33" class="font" scope="col"><div align="right">รหัสผู้ขอใช้บริการ :&nbsp;</div></th>
        <td width="410" class="font" scope="col"><div align="left"><? echo $row['App_ID'];?>&nbsp;</div></td>
      </tr>
      <tr>
        <th height="28" class="font"><div align="right">คำนำหน้า:&nbsp;</div></th>
        <td class="font"><? echo $row['App_Title'];?>&nbsp;</td>
      </tr>
      <tr>
        <th height="29"><div align="right" class="font">ชื่อ :</div></th>
        <td class="font"><? echo $row['App_Fname'];?>&nbsp;</td>
      </tr>
      <tr>
        <th height="31"><div align="right" class="font">สกุล :</div></th>
        <td class="font"><? echo $row['App_Lname'];?>&nbsp;</td>
      </tr>
      <tr>
        <th height="31"><div align="right"><span class="font">เบอร์โทรส่วนตัว :</span> </div></th>
        <td class="font"><? echo $row['Tel'];?>&nbsp;</td>
      </tr>
      <tr>
        <th height="31"><div align="right"><span class="font">เบอร์โทรภายใน :</span></div></th>
        <td class="font"><? echo $row['InternalTel'];?>&nbsp;</td>
      </tr>
      <tr>
        <th height="32"><div align="right"><span class="font">ตำแหน่ง :</span></div></th>
        <td class="font"><? echo $row['Position'];?>&nbsp;</td>
      </tr>
      <tr>
        <th height="26"><div align="right" class="font">หน่วยงาน :</div></th>
        <td class="font"><? echo $row['AgenciesName'];?>&nbsp;
		</td>
      </tr>
    </table>
   
	  <table width="381" border="0">
  <tr>
    <th width="375" height="42" scope="col">
	<? if($_GET["idemp"] == ""){?><input name="submit" type="submit" value="แก้ไข"onclick="document.location='edit_applicant.php'; " />&nbsp;
				<input type="reset" name="Submit4" value="ยกเลิก"  onclick="history.back(); " /><? }?>&nbsp;</th>
  </tr>
</table>
<? }?>
</th>
	<table width="200" border="0">
  <tr>
    <th scope="col">&nbsp;</th>
  </tr>
</table>
  </tr>
</table>
    </th>
  </tr>
</table>

</body>
</html>





Tag : PHP







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2011-03-15 04:26:03 By : worraya View : 910 Reply : 1
 

 

No. 1



โพสกระทู้ ( 74,058 )
บทความ ( 838 )

สมาชิกที่ใส่เสื้อไทยครีเอท

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

ใช้คำสั่ง UNION ครับ

Go to : SQL UNION






แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2011-03-15 17:30:56 By : webmaster
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : อยากดึงข้อมูลหน่วยงานที่อยู่อีกตารางขึ้นมาแสดงที่อยู่คนละตารางขึ้นมาแสดงค่ะ แต่มันไม่แสดงแต่ข้อความหน่วยงานขึ้นมาค่ะ โค้ดพอจะถูกมั้ยค่ะ หรือให้แก้ส่วนไหนกรุณาแนะนำหน่อยค่ะ
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ 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 04
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 อัตราราคา คลิกที่นี่