อยากให้หน้าค้นหาข้อมูลขึ้นข้อมูลประมาณนี้น่ะค่ะ
https://www.img.in.th/image/flEx แต่ว่ามันขึ้นเป็นแบบนี้น่ะค่ะ
https://www.img.in.th/image/flEM หนูจะให้รับค่าจากText Field หน้าแรกอ่ะค่ะ
https://www.img.in.th/image/fyB5 อันนี้เป็น ตารางdetail ค่ะ
https://www.img.in.th/image/fyBL ส่วนอันนี้เป็น ตารางorgans ค่ะ
https://www.img.in.th/image/fyBt ส่วนอันนี้ที่เชื่อมความสัมพันธ์ค่ะ
https://www.img.in.th/image/fyB1 ไม่รู้ว่าจะแก้ยังไง
อันนี้เป็นโค้ดค่ะ
<title>Expert shirt model</title>
<?php require_once('Connections/myconnection.php'); ?>
<?php $word1 = $_POST["word1"];
$word2 = $_POST["word2"];
$word3 = $_POST["word3"];
$word4 = $_POST["word4"];
$word5 = $_POST["word5"];
//คำสั่งติดต่อฐานข้อมูล
$objConnect = mysql_connect("127.0.0.1","root","") or die("Error Connect to Database");
//ชื่อฐานข้อมูล
$objDB = mysql_select_db("diseasedb1");
mysql_query("SET NAMES UTF8"); //ให้แสดงภาษาไทย
$strSQL = "SELECT DISTINCT id_detail, tb_detail.id_organs, organs, disease, intro,cause, symptem,refer,pic_or
FROM `tb_detail`
LEFT JOIN tb_organs ON tb_detail.id_organs = tb_organs.id_organs where tb_detail.id_organs in ('$word1','$word2','$word3','$word4','$word5') ";
$objQuery = mysql_query($strSQL) or die (mysql_error()." [".$strSQL."]");
?>
<table width="500" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><img src="หน้าปก.gif" width="1019" height="274"></td>
</tr>
</table>
<p> </p>
<table width="285" height="195" border="0" align="center" cellpadding="0" cellspacing="0">
<?php
//ทำการเช็คว่ามีการอ่านข้อมูลหรือไม่ ถ้ามีให้แสดงข้อมูล
while($objResult = mysql_fetch_array($objQuery))
{
?>
<tr>
<td><div align="center"><img src="img/<?php echo $objResult["pic_or"];?>" width="200"></div></td>
</tr>
</table>
<p> </p>
<table width="500" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="119">หมายเลขสำรวจ :</td>
<td width="381"><?php echo $objResult["id_organs"];?></div></td>
</tr>
</table>
<p> </p>
<table width="500" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="64">อวัยวะ :</td>
<td width="436"><?php echo $objResult["organs"];?></div></td>
</tr>
</table>
<p> </p>
<table width="404" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="134">โอกาสที่จะเกิดโรค :</td>
<td width="270"><?php echo $objResult["disease"];?></td>
</tr>
<?php
}
?>
</table>
<p> </p>