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 > PHP ดึงข้อมูลจากฐานข้อมูล จาก Web Server ที่เป็น IIS แล้วไม่ขึ้นครับ



 

PHP ดึงข้อมูลจากฐานข้อมูล จาก Web Server ที่เป็น IIS แล้วไม่ขึ้นครับ

 



Topic : 093437



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



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




อันนี้โค้ดครับ ตรงช่วงที่เป็นlist menu มันขึ้นเป็น "> แต่จำนวนที่ขึ้นเท่ากับข้อมูลในฐานข้อมูลเลย

Code (PHP)
<?php
	session_start();
	if($_SESSION['id_user'] == "")
	{
		echo "<META HTTP-EQUIV=\"Refresh\"CONTENT=\"2;URL=index.php\">";
		echo "<center><font size=+3><br><br>Please Login!</font></center>";
		exit();
	}
		session_start();
	if($_SESSION['status'] != "10" && $_SESSION['status'] != "70")
	{
		echo "<META HTTP-EQUIV=\"Refresh\"CONTENT=\"2;URL=index.php\">";
		echo "<center><font size=+3><br><br>This account has not been approved!</font></center>";
		exit();
	}
mysql_connect("localhost","root","bkkedu@2011");
	mysql_select_db("evaluate_training");
	mysql_query("SET NAME utf8");
	mysql_query("SET character_set_results=utf8");
	mysql_query("SET character_set_client=utf8");
	mysql_query("SET character_set_connection=utf8");
	$strSQL = "SELECT * FROM user WHERE id_user = '".$_SESSION['id_user']."' ";
	$objQuery = mysql_query($strSQL);
	$objResult = mysql_fetch_array($objQuery);

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ตรวจสอบแบบประเมินผลการอบรม</title>
<meta name="keywords" content="pink, business, website themes, design, free templates, website templates, CSS, HTML" />
<meta name="description" content="Pink Business Theme is a free website template from templatemo.com for all web designers and webmasters." />
<link href="templatemo_311_pink_business/templatemo_style.css" rel="stylesheet" type="text/css" />

<link rel="stylesheet" type="text/css" href="templatemo_311_pink_business/content_slider_style.css" />
<script type="text/javascript" src="templatemo_311_pink_business/js/jquery.1.3.2.min.js" ></script>
<script type="text/javascript" src="templatemo_311_pink_business/js/jquery-ui.min.js" ></script>
<script type="text/javascript">
	$(document).ready(function(){
		$("#featured > ul").tabs({fx:{opacity: "toggle"}}).tabs("rotate", 3000, true);
	});
</script>

</head>
<body>

<div id="templatemo_body_top">
<div id="templatemo_body_bottom">
<div id="templatemo_wrapper">
	<div id="templatemo_header">
        <div id="site_title">
	        <h1><a ><span><font size="7"><strong>ตรวจสอบแบบประเมินผลการอบรม</strong></font></span></a></h1>
        </div> <!-- end of site_title -->    
    </div>
<?php

if ($_SESSION['status'] == "70")
{
   ?>
	<div id="templatemo_menu">
        <ul>
            <li><a href="Administrator.php"><span><font size="5"><strong>กลับหน้าหลัก</strong></font></span></a></h1></li>
            <li><a href="addcourse.php"><span><font size="5"><strong>เพิ่มหลักสูตร</strong></font></span></a></li>
            <li><a href="sumprint1.php" target="_blank"><span><font size="5"><strong>พิมพ์สรุปแบบประเมิน</strong></font></span></a></li>
            <li><a href="logout.php"><span><font size="5"><strong>ออกจากระบบ</strong></font></span></a></li>
            <li></li>
        </ul>    	
    </div> 
    <?php
	}
	else if(($_SESSION['status'] != "70")){
		?>
		    <div id="templatemo_menu">
        <ul>
            <li><a href="admin1.php"><span><font size="5"><strong>อัพเดตหลักสูตร</strong></font></span></a></h1></li>
            <li></li>
            <li><a href="sumprint1.php" target="_blank"><span><font size="5"><strong>พิมพ์สรุปแบบประเมิน</strong></font></span></a></li>
            
            <li><a href="logout.php"><span><font size="5"><strong>ออกจากระบบ</strong></font></span></a></li>
            <li></li>
        </ul>    	
    </div> 
	<?php
		
	
}
	?>
    
	
	
    <!-- end of templatemo_menu -->
    
    <div id="templatemo_main_wrapper_01">
    <div id="templatemo_main_wrapper_02">
    <div id="templatemo_main_wrapper_03">
    <div id="templatemo_main">
    <div id="templatemo_slider"> <form id="form1" name="form1" method="post" action="?" />
      <p>
        <?php	$strSQL = "SELECT * FROM collected1";             
			$objQuery = mysql_query($strSQL); 
 			$objResult = mysql_fetch_array($objQuery); ?>
        หลักสูตร&nbsp; &nbsp; 
        <label>
          <select name="course" id="course" >                    
            <option value="0" selected="selected">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;กรุณาเลือกหลักสูตร</option>                   
            <?php    
		$course=$_POST['m_id'];             
		$strSQL = "SELECT * FROM coursemain ORDER BY m_id ASC";             
			$objQuery = mysql_query($strSQL); 
 			while($objResult = mysql_fetch_array($objQuery))            
			{                
			if($course == $objResult['course']){                                                   
			}            
			?>                    
            <option value="<?php =$objResult["m_id"];?>" >                      
              <?php =$objResult["course"];?>                      
              </option> 
            
            
            <?php           
				} 
        				?>          
            </select>
          </label>
        &nbsp; &nbsp;  รุ่น&nbsp; &nbsp; 
        <label>
          <select name="ver" id="ver" >                    
            <option value="0" selected="selected">กรุณาเลือกรุ่น</option>                   
            <?php    
		$ver=$_POST['v_id'];             
		$strSQL = "SELECT * FROM version ORDER BY v_id ASC";             
			$objQuery = mysql_query($strSQL); 
 			while($objResult = mysql_fetch_array($objQuery))            
			{                
			if($ver == $objResult['ver']){                                                   
			}            
			?>                    
            <option value="<?php =$objResult["ver"];?>" >                      
              <?php =$objResult["ver"];?>                      
              </option> 
            
            
            <?php           
				} 
        				?>          
            </select>
          </label>
        <?php $coursee=$_POST['course'];
$verr=$_POST['ver'];   
		$strSQL = "SELECT * FROM collected1 WHERE ver='$verr' and m_id ='$coursee';";             
			$objQuery = mysql_query($strSQL); 
 			$objResult = mysql_fetch_array($objQuery);?>
        <label>
          <input type="submit" name="ค้นหา" id="ค้นหา" value="ตกลง" />&nbsp;&nbsp;&nbsp; ระหว่างวันที่ &nbsp;&nbsp;<?php =$objResult["date"];?>
          </label>
        </form></p>
        
      <p>ชื่อวิทยากร &nbsp;&nbsp;<?php =$objResult["teacher"];?>&nbsp;&nbsp;&nbsp;&nbsp;สถานที่ &nbsp;&nbsp;<?php =$objResult["add"];?></p>
    </div>
    
        </div>
    <?php
		if($_POST) 
		{
			$verr=$_POST['ver'];
			$coursee=$_POST['course'];
			
		if((!empty($verr)) && (!empty($coursee))){
	$strSQL= "SELECT id_c,c.id_user,c.ver,c.q1,c.q2,c.q3,c.q4,c.q5,c.q6,c.q7,c.q8,c.q9,c.q10,c.q11,c.q12,c.q13,c.q14,c.q15,c.Suggestions
		FROM collected1 c , version v  ,coursemain m
		WHERE (v.ver = c.ver) and  (c.ver  = '$verr' and m.m_id ='$coursee') AND c.m_id LIKE '%".$coursee."%' AND c.ver LIKE '%".$verr."%' AND c.ver LIKE '%".$verr."%'"; 
	$objQuery = mysql_query($strSQL) or die(mysql_error());
	$row = mysql_num_rows($objQuery);
	echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"."&nbsp;มีข้อมูลจำนวน&nbsp;".$row."&nbsp;แถว&nbsp;";
		
	}
		
		else if((!empty($verr))){
	$strSQL= "SELECT DISTINCT id_c,c.id_user,c.ver,c.q1,c.q2,c.q3,c.q4,c.q5,c.q6,c.q7,c.q8,c.q9,c.q10,c.q11,c.q12,c.q13,c.q14,c.q15,c.Suggestions
		FROM collected1 c , version v  ,coursemain m
		WHERE (v.ver = c.ver) and  (c.ver  = '$verr') AND c.ver LIKE '%".$verr."%'"; 
	$objQuery = mysql_query($strSQL) or die(mysql_error());
		$row = mysql_num_rows($objQuery);
	echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"."&nbsp;มีข้อมูลจำนวน".$row. "&nbsp;แถว";
			
	}
	else if((!empty($coursee))){
	$strSQL= "SELECT DISTINCT id_c,c.id_user,c.ver,c.q1,c.q2,c.q3,c.q4,c.q5,c.q6,c.q7,c.q8,c.q9,c.q10,c.q11,c.q12,c.q13,c.q14,c.q15,c.Suggestions
		FROM collected1 c , version v  ,coursemain m
		WHERE (m.m_id = c.m_id) and  (c.m_id ='$coursee') AND c.m_id LIKE '%".$coursee."%'"; 
	$objQuery = mysql_query($strSQL) or die(mysql_error());
		$row = mysql_num_rows($objQuery);
	echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"."มีข้อมูลจำนวน&nbsp;".$row."&nbsp;แถว";
			
	}
	
			?>
    <center> 
      <table width="897" border="1" bordercolor="#4A2547" cellpadding="0" cellspacing="0" class="sp2">
        <tr>
          <th width="4%" nowrap="nowrap" bgcolor="#E6D8E0">เลขที่</th>
          <th width="3%" height="40" nowrap="nowrap" bgcolor="#E6D8E0">ผู้ใช้</th>
          <th width="3%" nowrap="nowrap" bgcolor="#E6D8E0">1</th>
          <th width="3%" nowrap="nowrap" bgcolor="#E6D8E0">2</th>
          <th width="3%" nowrap="nowrap" bgcolor="#E6D8E0">3</th>
          <th width="3%" nowrap="nowrap" bgcolor="#E6D8E0">4</th>
          <th width="3%" nowrap="nowrap" bgcolor="#E6D8E0">5</th>
          <th width="3%" nowrap="nowrap" bgcolor="#E6D8E0">6</th>
          <th width="3%" nowrap="nowrap" bgcolor="#E6D8E0">7</th>
          <th width="3%" nowrap="nowrap" bgcolor="#E6D8E0">8</th>
          <th width="3%" nowrap="nowrap" bgcolor="#E6D8E0">9</th>
          <th width="3%" nowrap="nowrap" bgcolor="#E6D8E0">10</th>
          <th width="3%" nowrap="nowrap" bgcolor="#E6D8E0">11</th>
          <th width="3%" nowrap="nowrap" bgcolor="#E6D8E0">12</th>
          <th width="3%" nowrap="nowrap" bgcolor="#E6D8E0">13</th>
          <th width="3%" nowrap="nowrap" bgcolor="#E6D8E0">14</th>
          <th width="3%" nowrap="nowrap" bgcolor="#E6D8E0">15</th>
          <th width="24%" nowrap="nowrap" bgcolor="#E6D8E0">ข้อเสนอแนะ
          </th>
          <th width="4%" nowrap="nowrap" bgcolor="#E6D8E0">แก้ไข</th>
          <th width="4%" nowrap="nowrap" bgcolor="#E6D8E0">ลบ</th>
        </tr>
		<?php
	while($objResult = mysql_fetch_array($objQuery))
	{
?>
        <tr>
          <th width="4%"><?php =$objResult["id_c"];?></th>
          <th width="3%"><?php =$objResult["id_user"];?></th>
          <th width="3%"><?php =$objResult["q1"];?></th>
          <th width="3%"><?php =$objResult["q2"];?></th>
          <th width="3%"><?php =$objResult["q3"];?></th>
          <th width="3%"><?php =$objResult["q4"];?></th>
          <th width="3%"><?php =$objResult["q5"];?></th>
          <th width="3%"><?php =$objResult["q6"];?></th>
          <th width="3%"><?php =$objResult["q7"];?></th>
          <th width="3%"><?php =$objResult["q8"];?></th>
          <th width="3%"><?php =$objResult["q9"];?></th>
          <th width="3%"><?php =$objResult["q10"];?></th>
          <th width="3%"><?php =$objResult["q11"];?></th>
          <th width="3%"><?php =$objResult["q12"];?></th>
          <th width="3%"><?php =$objResult["q13"];?></th>
          <th width="3%"><?php =$objResult["q14"];?></th>
          <th width="3%"><?php =$objResult["q15"];?></th>
          <th width="24%" align="left"><?php =$objResult["Suggestions"];?> </th>
          <th><a href="sum1edit.php?id_c=<?php =$objResult["id_c"];?><img src='img/icon/pencile.png'></a></th>
          <th><center><a href="sum1del.php?id_c=<?php =$objResult["id_c"];?><img src='img/icon/delete_16.png'></a></center></th>
          </tr>
           <?php
	}
				 ?>
      </table></center>
      <?php
	}				 ?>
</div> 
    <!-- end of templatemo_slider -->
   
    	

             <!-- end of templatemo_slider -->
        
        <div class="cleaner"></div>
        <div class="cleaner"></div>
    </div><div class="cleaner"></div>
    </div>
    </div>
    
    <div id="templatemo_footer"></div>
</div>
</div>
</div>
</body>
</html>




Tag : PHP







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2013-04-05 12:28:49 By : white31969 View : 870 Reply : 4
 

 

No. 1



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



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


ช่วยดูให้ทีนะครับด่วนมากเลยย






แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-04-05 13:16:19 By : white31969
 


 

No. 2



โพสกระทู้ ( 4,169 )
บทความ ( 7 )

Hall of Fame 2012

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


mysql_connect("localhost","root","bkkedu@2011") or die (mysql_error());
mysql_select_db("evaluate_training") or die (mysql_error());
มี Error มั้ยครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-04-05 13:39:43 By : Ex-[S]i[L]e[N]t
 

 

No. 3



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



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


ได้แล้วครับผม ต้องเป็น<?php ?> ทุกตัว แล้ว <?php =$objResult["fild"];?> ก็ไม่ได้ ต้องเป็น<?php echo $objResult["fild"];?>

ขอบคุณมากครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-04-05 14:16:49 By : white31969
 


 

No. 4



โพสกระทู้ ( 4,169 )
บทความ ( 7 )

Hall of Fame 2012

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


ตอบความคิดเห็นที่ : 3 เขียนโดย : white31969 เมื่อวันที่ 2013-04-05 14:16:49
รายละเอียดของการตอบ ::


แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2013-04-05 14:17:31 By : Ex-[S]i[L]e[N]t
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : PHP ดึงข้อมูลจากฐานข้อมูล จาก Web Server ที่เป็น IIS แล้วไม่ขึ้นครับ
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ 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 03
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 อัตราราคา คลิกที่นี่