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 > ต้องการดึงข้อมูลจาก colum เดียวกันต้องดึงยังไงครับ



 

ต้องการดึงข้อมูลจาก colum เดียวกันต้องดึงยังไงครับ

 



Topic : 115231



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



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




One Colum

จากรูปอ่ะครับ
ผมต้องการดึงข้อมูลว่ามีใครบ้างในคอลัม allergens ที่มีค่า Histamine และ Kapok
จะต้องดึงยังไงอ่ะครับ



Tag : PHP, MySQL







Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2015-03-19 10:40:41 By : Clamore View : 652 Reply : 4
 

 

No. 1

Guest


Code (SQL)
select * from tbxxx where allergens in ('Histamine','Kapok')







แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2015-03-19 11:17:06 By : ไม่ทราบแหล่งที่มา
 


 

No. 2



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



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


ต้องเห็นแบบฟอร์ม input ข้อมูลเข้ามา ในการจะทำการselect ครั้งนี้ก่อนครับถึงจะตอบได้
ถ้ายังไม่ออกแบบฟอร์ม input ก็ตอบได้นะ แต่มันจะไม่ถูกเพราะมีหลายวิธีมาก
ดังนั้นถ้าจะ SELECT อะไรซักอย่าง ที่มีการ WHERE (แบบหลากหลาย) เราต้องสร้างแบบฟอร์มก่อนครับ
ถึงจะออกแบบคิวรี่ได้


ประวัติการแก้ไข
2015-03-19 13:38:36
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2015-03-19 13:37:42 By : meannerss
 

 

No. 3



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



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


Code (PHP)
<html>
<head>
<title>สาขาวิชาโรคภูมิแพ้และอิมมูโนวิทยา </title>

<meta http-equiv="Content-Type" content="text/html; charset=tis-620">
<script type="text/javascript" src="scripts/jquery-1.4.3.min.js"></script>
	<script type="text/javascript" src="fancybox/jquery.mousewheel-3.0.4.pack.js"></script>
	<script type="text/javascript" src="fancybox/jquery.fancybox-1.3.4.pack.js"></script>
	<link rel="stylesheet" type="text/css" href="fancybox/jquery.fancybox-1.3.4.css" media="screen" />

<script language="JavaScript">

	function lock()
	{
		
		document.getElementById('skintest').disabled = true;
		document.getElementById('others').disabled = true;
		document.getElementById('sl1').disabled = true;
		document.getElementById('ch1').disabled = true;
		document.getElementById('wheal1').disabled = true;

		document.getElementById('skintest2').disabled = true;
		document.getElementById('others2').disabled = true;
		document.getElementById('sl2').disabled = true;
		document.getElementById('ch2').disabled = true;
		document.getElementById('wheal2').disabled = true;

		document.getElementById('skintest3').disabled = true;
		document.getElementById('others3').disabled = true;
		document.getElementById('sl3').disabled = true;
		document.getElementById('ch3').disabled = true;
		document.getElementById('wheal3').disabled = true;

		document.getElementById('skintest4').disabled = true;
		document.getElementById('others4').disabled = true;
		document.getElementById('sl4').disabled = true;
		document.getElementById('ch4').disabled = true;
		document.getElementById('wheal4').disabled = true;

		//document.getElementById('other').readOnly  = true;
		/*document.getElementById('choise').disabled = true;
		document.getElementById('choise1').disabled = true;
		document.getElementById('choise2').disabled = true;*/
		
		//document.getElementById('choise3').disabled = true;
		//document.getElementById('choise4').disabled = true;
	}

	function skin()
		{
			if (document.getElementById('skintest').value=="other")
			{
			document.getElementById('others').readOnly = false;
			document.getElementById('others').value = "";
			}
			else
			{
			document.getElementById('others').readOnly = true;
			document.getElementById('others').value = document.getElementById('skintest').value;			
			}
		}

	function skin2()
	{
			if (document.getElementById('skintest2').value=="other")
			{
			document.getElementById('others2').readOnly = false;
			document.getElementById('others2').value = "";
			}
			else
			{
			document.getElementById('others2').readOnly = true;
			document.getElementById('others2').value = document.getElementById('skintest2').value;			
			}
	}
	function skin3()
	{
			if (document.getElementById('skintest3').value=="other")
			{
			document.getElementById('others3').readOnly = false;
			document.getElementById('others3').value = "";
			}
			else
			{
			document.getElementById('others3').readOnly = true;
			document.getElementById('others3').value = document.getElementById('skintest3').value;			
			}
	}
	function skin4()
	{
			if (document.getElementById('skintest4').value=="other")
			{
			document.getElementById('others4').readOnly = false;
			document.getElementById('others4').value = "";
			}
			else
			{
			document.getElementById('others4').readOnly = true;
			document.getElementById('others4').value = document.getElementById('skintest4').value;			
			}
	}

	function sym1()
		{
			if (document.getElementById('sl1').value=="yes")
			{
			document.getElementById('wheal1').readOnly = false;
			document.getElementById('wheal1').value = "";
			}
			else
			{
			document.getElementById('wheal1').readOnly = true;
			document.getElementById('wheal1').value = 0;			
			}
		}
	
	function sym2()
		{
			if (document.getElementById('sl2').value=="yes")
			{
			document.getElementById('wheal2').readOnly = false;
			document.getElementById('wheal2').value = "";
			}
			else
			{
			document.getElementById('wheal2').readOnly = true;
			document.getElementById('wheal2').value = 0;			
			}
		}

	function sym3()
		{
			if (document.getElementById('sl3').value=="yes")
			{
			document.getElementById('wheal3').readOnly = false;
			document.getElementById('wheal3').value = "";
			}
			else
			{
			document.getElementById('wheal3').readOnly = true;
			document.getElementById('wheal3').value = 0;			
			}
		}

	function sym4()
		{
			if (document.getElementById('sl4').value=="yes")
			{
			document.getElementById('wheal4').readOnly = false;
			document.getElementById('wheal4').value = "";
			}
			else
			{
			document.getElementById('wheal4').readOnly = true;
			document.getElementById('wheal4').value = 0;			
			}
		}

		function lockskin()
		{
			if (document.getElementById('skinpick').value=="no")
			{
				document.getElementById('skintest').disabled = true;
				document.getElementById('others').disabled = true;
				document.getElementById('sl1').disabled = true;
				document.getElementById('ch1').disabled = true;
				document.getElementById('wheal1').disabled = true;

				document.getElementById('skintest2').disabled = true;
				document.getElementById('others2').disabled = true;
				document.getElementById('sl2').disabled = true;
				document.getElementById('ch2').disabled = true;
				document.getElementById('wheal2').disabled = true;

				document.getElementById('skintest3').disabled = true;
				document.getElementById('others3').disabled = true;
				document.getElementById('sl3').disabled = true;
				document.getElementById('ch3').disabled = true;
				document.getElementById('wheal3').disabled = true;

				document.getElementById('skintest4').disabled = true;
				document.getElementById('others4').disabled = true;
				document.getElementById('sl4').disabled = true;
				document.getElementById('ch4').disabled = true;
				document.getElementById('wheal4').disabled = true;
			}
			else
			{
				document.getElementById('skintest').disabled = false;
				document.getElementById('others').disabled = false;			
				document.getElementById('sl1').disabled = false;
				document.getElementById('ch1').disabled = false;
				document.getElementById('wheal1').disabled = false;

				document.getElementById('skintest2').disabled = false;
				document.getElementById('others2').disabled = false;
				document.getElementById('sl2').disabled = false;
				document.getElementById('ch2').disabled = false;
				document.getElementById('wheal2').disabled = false;

				document.getElementById('skintest3').disabled = false;
				document.getElementById('others3').disabled = false;
				document.getElementById('sl3').disabled = false;
				document.getElementById('ch3').disabled = false;
				document.getElementById('wheal3').disabled = false;

				document.getElementById('skintest4').disabled = false;
				document.getElementById('others4').disabled = false;
				document.getElementById('sl4').disabled = false;
				document.getElementById('ch4').disabled = false;
				document.getElementById('wheal4').disabled = false;

			}
		}

	</script>	

</head>

<body onload="Javascript:lock();">
<table border="0" align="center">
<tr>
		<td align="center">
			<img src="image/head.jpg" width="800" height="150" border="0" alt="">
		</td>
</tr>
<tr>
		<td>
		<hr>
<div id="" class="">
		<a href="immu.php">หน้าหลัก</a>
	</div>

<form method="post" action="<?=$_SERVER["SCRIPT_NAME"]?>?search=skin">
<table>
<tr>
	<td>ลักษณะอาการ : </td>
	<td>
	<select name="skinpick" id="skinpick" onchange="javascript:lockskin();">
			<option value="" selected>กรุณาเลือก</option>
			<option value="yes">มีอาการแพ้</option>
			<option value="no">ไม่มีอาการแพ้</option>
	</select>
	</td>
</tr>
</table>
	
<table align="center" border="1">
<th colspan="2">Allergens</th>
<th colspan="2">ลักษณะอาการ</th>

<tr>
	<td><input type="checkbox" name="ch1" id="ch1" value="1"></td>
	<td>
	<select name="skintest" id="skintest" onChange="JavaScript:skin();">
			<option value="" selected>กรุณาเลือก</option>
			<option value="Buffer Saline">Buffer Saline</option>
			<option value="Histamine">Histamine</option>
			<option value="Mite D.P.">Mite D.P.</option>
			<option value="Mite D.F.">Mite D.F.</option>
			<option value="Kapok">Kapok</option>
			<option value="Cat">Cat</option>
			<option value="Dog">Dog</option>
			<option value="Mouse epithelium">Mouse epithelium</option>
			<option value="Rat epithelia">Rat epithelia</option>
			<option value="American cockroach">American cockroach</option>
			<option value="German cockroach">German cockroach</option>
			<option value="Bermuda grass">Bermuda grass</option>
			<option value="John grass">John grass</option>
			<option value="Careless weed">Careless weed</option>
			<option value="Acacia">Acacia</option>
			<option value="Penicillium">Penicillium</option>
			<option value="Aspergillus">Aspergillus</option>
			<option value="Alternalia">Alternalia</option>
			<option value="other">อื่นๆ</option>
		</select>
		<input type="text" name="others" id="others">
	</td>
	<td align="center">
	<select name="sl1" id="sl1" onchange="javascript:sym1();">
			<option value="" selected>กรุณาเลือก</option>
			<option value="yes">มีอาการแพ้</option>
			<option value="no">ไม่มีอาการแพ้</option>
	</select>
	</td>
	<td align="center">
	<input type="text" name="wheal1" id="wheal1">
	</td>
	
</tr>

<!-- /********* 2 **********/ -->
<tr>
	<td><input type="checkbox" name="ch2" id="ch2" value="1"></td>
	<td>
	<select name="skintest2" id="skintest2" onChange="JavaScript:skin2();">
			<option value="" selected>กรุณาเลือก</option>
			<option value="Buffer Saline">Buffer Saline</option>
			<option value="Histamine">Histamine</option>
			<option value="Mite D.P.">Mite D.P.</option>
			<option value="Mite D.F.">Mite D.F.</option>
			<option value="Kapok">Kapok</option>
			<option value="Cat">Cat</option>
			<option value="Dog">Dog</option>
			<option value="Mouse epithelium">Mouse epithelium</option>
			<option value="Rat epithelia">Rat epithelia</option>
			<option value="American cockroach">American cockroach</option>
			<option value="German cockroach">German cockroach</option>
			<option value="Bermuda grass">Bermuda grass</option>
			<option value="John grass">John grass</option>
			<option value="Careless weed">Careless weed</option>
			<option value="Acacia">Acacia</option>
			<option value="Penicillium">Penicillium</option>
			<option value="Aspergillus">Aspergillus</option>
			<option value="Alternalia">Alternalia</option>
			<option value="other">อื่นๆ</option>
		</select>
		<input type="text" name="others2" id="others2">
	</td>
	<td align="center">
	<select name="sl2" id="sl2" onchange="javascript:sym2();">
			<option value="" selected>กรุณาเลือก</option>
			<option value="yes">มีอาการแพ้</option>
			<option value="no">ไม่มีอาการแพ้</option>
	</select>
	</td>
	<td align="center">
	<input type="text" name="wheal2" id="wheal2">
	</td>
	
</tr>

<!-- /********* 3 **********/ -->
<tr>
	<td><input type="checkbox" name="ch3" id="ch3" value="1"></td>
	<td>
	<select name="skintest3" id="skintest3" onChange="JavaScript:skin3();">
			<option value="" selected>กรุณาเลือก</option>
			<option value="Buffer Saline">Buffer Saline</option>
			<option value="Histamine">Histamine</option>
			<option value="Mite D.P.">Mite D.P.</option>
			<option value="Mite D.F.">Mite D.F.</option>
			<option value="Kapok">Kapok</option>
			<option value="Cat">Cat</option>
			<option value="Dog">Dog</option>
			<option value="Mouse epithelium">Mouse epithelium</option>
			<option value="Rat epithelia">Rat epithelia</option>
			<option value="American cockroach">American cockroach</option>
			<option value="German cockroach">German cockroach</option>
			<option value="Bermuda grass">Bermuda grass</option>
			<option value="John grass">John grass</option>
			<option value="Careless weed">Careless weed</option>
			<option value="Acacia">Acacia</option>
			<option value="Penicillium">Penicillium</option>
			<option value="Aspergillus">Aspergillus</option>
			<option value="Alternalia">Alternalia</option>
			<option value="other">อื่นๆ</option>
		</select>
		<input type="text" name="others3" id="others3">
	</td>
	<td align="center">
	<select name="sl3" id="sl3" onchange="javascript:sym3();">
			<option value="" selected>กรุณาเลือก</option>
			<option value="yes">มีอาการแพ้</option>
			<option value="no">ไม่มีอาการแพ้</option>
	</select>
	</td>
	<td align="center">
	<input type="text" name="wheal3" id="wheal3">
	</td>
	
</tr>

<!-- /********* 4 **********/ -->
<tr>
	<td><input type="checkbox" name="ch4" id="ch4" value="1"></td>
	<td>
	<select name="skintest4" id="skintest4" onChange="JavaScript:skin4();">
			<option value="" selected>กรุณาเลือก</option>
			<option value="Buffer Saline">Buffer Saline</option>
			<option value="Histamine">Histamine</option>
			<option value="Mite D.P.">Mite D.P.</option>
			<option value="Mite D.F.">Mite D.F.</option>
			<option value="Kapok">Kapok</option>
			<option value="Cat">Cat</option>
			<option value="Dog">Dog</option>
			<option value="Mouse epithelium">Mouse epithelium</option>
			<option value="Rat epithelia">Rat epithelia</option>
			<option value="American cockroach">American cockroach</option>
			<option value="German cockroach">German cockroach</option>
			<option value="Bermuda grass">Bermuda grass</option>
			<option value="John grass">John grass</option>
			<option value="Careless weed">Careless weed</option>
			<option value="Acacia">Acacia</option>
			<option value="Penicillium">Penicillium</option>
			<option value="Aspergillus">Aspergillus</option>
			<option value="Alternalia">Alternalia</option>
			<option value="other">อื่นๆ</option>
		</select>
		<input type="text" name="others4" id="others4">
	</td>
	<td align="center">
	<select name="sl4" id="sl4" onchange="javascript:sym4();">
			<option value="" selected>กรุณาเลือก</option>
			<option value="yes">มีอาการแพ้</option>
			<option value="no">ไม่มีอาการแพ้</option>
	</select>
	</td>
	</td>
	<td align="center">
	<input type="text" name="wheal4" id="wheal4">
	</td>
	
</tr>
<tr>
	<td colspan="4" align="center">
	<input type="submit" value="ค้นหา">
</tr>
</table>
</form>


Form

รูปหน้า form ครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2015-03-19 15:13:44 By : Clamore
 


 

No. 4



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



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


function ที่ มีโครงสร้างเหมือนกัน ปรับมาใช้ตัวเดียวกันดีกว่าครับ

skin กับ sym ต้างกันแค่แค่ชื่อ

Code (JavaScript)
function skinsym1( nm1, nm2 )
{
			if (document.getElementById(nm1).value=="yes")
			{
			document.getElementById(nm2).readOnly = false;
			document.getElementById(nm2).value = "";
			}
			else
			{
			document.getElementById(nm2).readOnly = true;
			document.getElementById(nm2).value = 0;			
			}
}

ลองประยุกต์ดูนะครับ ส่วนอย่างอื่นยังไม่ได้อ่านครับ เห็นแค่ฟังก์ชั่น ซ้ำๆ ก็บอกอันนี้ก่อน
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2015-03-19 16:55:24 By : Chaidhanan
 

   

ค้นหาข้อมูล


   
 

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