Viewing file: test_bio.php (6.51 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-874"> <link rel="StyleSheet" href="css/style.css" TYPE="text/css"> <script type="text/javascript" language="JavaScript1.2" src="jsscript/stm31.js"></script> <title>:-: BCNU Web Services :-:</title> <body> <? $host="localhost"; $username="root"; $pass_word=""; $db="reg"; //mysql_query("SET NAMES TIS620"); mysql_connect( $host,$username,$pass_word) or die ("ติดต่อกับฐานข้อมูล Mysql ไม่ได้ "); mysql_select_db($db) or die("เลือกฐานข้อมูลไม่ได้"); mysql_query("SET character_set_results=tis620"); mysql_query("SET character_set_client=tis620"); mysql_query("SET character_set_connection=tis620");
//$sql = "SELECT studentId, StudentMaster.studentCode , birthDate, birthProvinceId, homeAddress, homeDistrictId, homeAmphurId, homeProvinceId, homeZipcode, homePhoneNo, fatherName, fatherOccupation, motherName, motherOccupation, parentName, parentRelation, parentAddress, parentDistrictId , parentAmphurId, parentProvinceId, parentZipcode, parentPhoneNo, parentMobile, parentOcc, parentIncome, entryDegree FROM StudentBio, StudentMaster WHERE (StudentBio.studentId =StudentMaster.studentId)"; //$dbquery = mysql_query($sql);nationId religionId and (StudentBio.entryDegree=Degree.degreeId) //amphurId amphurName districtId districtName provinceId provinceName and (StudentMaster.studentCode='492101001') //$SQL = "SELECT * FROM StudentBio, StudentMaster, Prefix, Scholar, EntryType, District , Amphur , Province , PreAdmitPosition, Nation, Religion, Degree WHERE
$SQL = "SELECT * FROM StudentBio, StudentMaster, Prefix, Scholar, PreAdmitPosition, Nation, Religion WHERE (StudentMaster.studentCode='492101001') and (StudentBio.studentId =StudentMaster.studentId) and (StudentMaster.prefixId = Prefix.prefixId)"; //and (StudentMaster.scholarId=Scholar.scholarId) and (Scholar.provinceId=Province.provinceId) and (StudentMaster.entryTypeId=EntryType.entryTypeId) and (StudentMaster.preAdmitPositionId=PreAdmitPosition.preAdmitPositionId) and (StudentBio.nationId=Nation.nationId) and (StudentBio.religionId=Religion.religionId)"; $table = mysql_query($SQL) or die("ไม่สามารถเรียกดูข้อมูลในเทเบิลได้"); echo "<table border=1>"; echo "<tr>"; echo "<td>ที่</td>"; echo "<td>รหัสนักศึกษา</td>"; echo "<td>คำนำหน้า</td>"; echo "<td>ชื่อ</td>"; echo "<td>นามสกุล</td>"; echo "<td>เจ้าของทุน</td>"; echo "<td>จังหวัด</td>"; echo "<td>สถานะก่อนเข้าเรียน</td>"; echo "<td>ประเภททุน</td>"; echo "<td>เลขที่บัตรประจำตัวประชาชน</td>"; echo "<td>สัญชาติ</td>"; echo "<td>ศาสนา</td>"; echo "<td>วันเกิด</td>"; echo "<td>จังหวัดที่เกิด</td>"; echo "<td>ที่อยู่นักศึกษาตามภูมิลำเนา</td>"; echo "<td>ตำบลตามภูมิลำเนา</td>"; echo "<td>อำเภอตามภูมิลำเนา</td>"; echo "<td>จังหวัดตามภูมิลำเนา</td>"; echo "<td>รหัสไปรษณีย์ตามภูมิลำเนา</td>"; echo "<td>เบอร์โทรศัพท์บ้านตามภูมิลำเนา</td>"; echo "<td>ชื่อ-สกุลบิดา</td>"; echo "<td>อาชีพบิดา</td>"; echo "<td>ชื่อ-สกุลมารดา</td>"; echo "<td>อาชีพมารดา</td>"; echo "<td>ชื่อ-สกุลผู้ปกครอง</td>"; echo "<td>ความสัมพันธ์กับนักศึกษา</td>"; echo "<td>ที่อยู่ผู้ปกครองที่สามารถติดต่อได้</td>"; echo "<td>ตำบลผู้ปกครอง</td>"; echo "<td>อำเภอผู้ปกครอง</td>"; echo "<td>จังหวัดผู้ปกครอง</td>"; echo "<td>รหัสไปรษณีย์ผู้ปกครอง</td>"; echo "<td>เบอร์โทรศัพท์บ้านผู้ปกครอง </td>"; echo "<td>เบอร์โทรศัพท์มือถือผู้ปกครอง</td>"; echo "<td>อาชีพผู้ปกครอง</td>"; echo "<td>รายได้ผู้ปกครอง</td>"; echo "<td>วุฒิการศึกษาก่อนรับเข้า</td>"; echo "</tr>"; $num = "1"; while($row = mysql_fetch_array($table)) { $num1++; $stu_id = $row["studentId"]; $stu_code = $row["studentCode"]; $stu_prefix = $row["prefixName"]; $stu_name= $row["studentName"]; $stu_surname = $row["studentSurname"]; $stu_scholar = $row["scholarName"]; $stu_scholarprovince = $row["provinceName"]; $stu_positionname = $row["positionName"]; $stu_entryname = $row["entryTypeName"]; $stu_citizen = $row["citizenId"]; $stu_nationname = $row["nationName"]; /*$stu_religionname = $row["religionName"]; $stu_birthdate = $row["birthDate"]; $stu_birthprovince = $row["birthProvinceId"]; $stu_homeaddress = $row["homeAddress"]; $stu_homedistrict= $row["homeDistrictId"]; $stu_homeamphur = $row["homeAmphurId"]; $stu_homeprovince = $row["homeProvinceId"]; $stu_homezipcode = $row["homeZipcode"]; $stu_homephone = $row["homePhoneNo"]; $stu_fathername = $row["fatherName"]; $stu_fatherocc = $row["fatherOccupation"]; $stu_mothername = $row["motherName"]; $stu_motherocc = $row["motherOccupation"]; $stu_parentname = $row["parentName"]; $stu_parentrelation = $row["parentRelation"]; $stu_parentaddress= $row["parentAddress"]; $stu_parentdistrict = $row["parentDistrictId"]; $stu_parentamphur = $row["parentAmphurId"]; $stu_parentprovince = $row["parentProvinceId"]; $stu_parentzipcode = $row["parentZipcode"]; $stu_parentphone = $row["parentPhoneNo"]; $stu_parentmobile = $row["parentMobile"]; $stu_parentocc = $row["parentOcc"]; $stu_parentincome = $row["parentIncome"]; //$stu_entrydegree = $row["degreeName"]; */ echo "<tr>"; echo "<td>$stu_id</a></td>"; echo "<td>$stu_code</td>"; echo "<td>$stu_prefix</td>"; echo "<td>$stu_name</td>"; echo "<td>$stu_surname</td>"; echo "<td>$stu_scholar</td>"; echo "<td>$stu_scholarprovince</td>"; echo "<td>$stu_positionname</td>"; echo "<td>$stu_entryname</td>"; echo "<td>$stu_citizen</td>"; echo "<td>$stu_nationname</td>"; echo "<td>$stu_religionname</td>"; echo "<td>$stu_birthdate</td>"; echo "<td>$stu_birthprovince</td>"; echo "<td>$stu_homeaddress</td>"; echo "<td>$stu_homedistrict</td>"; echo "<td>$stu_homeamphur</td>"; echo "<td>$stu_homeprovince</td>"; echo "<td>$stu_homezipcode</td>"; echo "<td>$stu_homephone</td>"; echo "<td>$stu_fathername</td>"; echo "<td>$stu_fatherocc</td>"; echo "<td>$stu_mothername</td>"; echo "<td>$stu_motherocc</td>"; echo "<td>$stu_parentname</td>"; echo "<td>$stu_parentrelation</td>"; echo "<td>$stu_parentaddress</td>"; echo "<td>$stu_parentdistrict</td>"; echo "<td>$stu_parentamphur</td>"; echo "<td>$stu_parentprovince</td>"; echo "<td>$stu_parentzipcode</td>"; echo "<td>$stu_parentphone</td>"; echo "<td>$stu_parentmobile</td>"; echo "<td>$stu_parentocc</td>"; echo "<td>$stu_parentincome</td>"; //echo "<td>$stu_entrydegree</td>"; echo "</tr><br>"; echo "</table>"; } mysql_close();
?> </body> </html>
|