|
|
|
อยากทราบว่าเวลาเราใช้ inner join นี่จำเป็นต้องใช้ค่าที่เราดึงมาทุกตัวหรือไม่ค่ะ |
|
|
|
|
|
|
|
คือพอใช้ไม่ครบมันไม่แสดงค่าอ่ะค่ะ ไม่รู้ว่าทำผิดยังไงCode (PHP)
<?php include('includes/globals.config.php'); ?>
<?php $pName = EDITFAQS;?>
<?
$strSQL = "SELECT tb_addresscom.Id_Addresscom, tb_addresscom.build_name, tb_addresscom.name_Addresscom, tb_computer.Id_Computer, tb_computer.Id_AddressCom, tb_computer.Int_Computer, tb_computer.IP_Computer, tb_computer.Id_UserGeneral, tb_servicerequest.Id_ServiceRequest, tb_servicerequest.type_ServiceRequest, tb_servicerequest.Id_stylejob, tb_servicerequest.Id_Information, tb_servicerequest.Subject_ServiceRequest, tb_servicerequest.Proble_ServiceRequest, tb_servicerequest.Detail_ServiceRequest, tb_servicerequest.typeSpeed, tb_servicerequest.Id_StatusRequest, tb_servicerequest.Id_Computer, tb_servicerequest.Id_UserGeneral, tb_servicerequest.Date_ServiceRequest, tb_servicerequest.Time_ServiceRequest, tb_servicerequest.Dateans_ServiceRequest, tb_servicerequest.Timeans_serviceRequest, tb_servicerequest.countdate_ServiceRequest, tb_servicerequest.approve_ServiceRequest, tb_servicerequest.New_ServiceRequest, tb_statusrequest.Id_StatusRequest, tb_statusrequest.Name_StatusRequest, tb_usergeneral.Id_UserGeneral, tb_usergeneral.name_UserGeneral, tb_usergeneral.phone_UserGeneral, tb_usergeneral.email_UserGeneral, tb_usergeneral.Id_Position, tb_usergeneral.Id_Agencies, tb_usergeneral.Username_General, tb_usergeneral.inst_date, tb_usergeneral.inst_user, tb_position.Id_Position, tb_position.name_Position, tb_agencies.Id_Agencies, tb_agencies.name_Agencies, tb_stylejob.name_stylejob, tb_stylejob.Id_stylejob, tb_stylejob.typeService FROM tb_addresscom Inner Join tb_computer ON tb_computer.Id_AddressCom = tb_addresscom.Id_Addresscom , tb_servicerequest Inner Join tb_statusrequest ON tb_servicerequest.Id_StatusRequest = tb_statusrequest.Id_StatusRequest Inner Join tb_usergeneral ON tb_servicerequest.Id_UserGeneral = tb_usergeneral.Id_UserGeneral Inner Join tb_position ON tb_usergeneral.Id_Position = tb_position.Id_Position Inner Join tb_agencies ON tb_usergeneral.Id_Agencies = tb_agencies.Id_Agencies Inner Join tb_stylejob ON tb_servicerequest.Id_stylejob = tb_stylejob.Id_stylejob Where tb_servicerequest.Id_ServiceRequest = '".$_GET['cId']."'";
$rs_service= mysql_query($strSQL);
$row_rs_service= mysql_fetch_array($rs_service);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE><?=PROJECT_VERSION;?></TITLE>
<META http-equiv=Content-Type content="text/html; charset=windows-874">
<META content="Web Application" name=GENERATOR>
<SCRIPT type="text/javascript" src="js/global.js" ></SCRIPT>
<SCRIPT type="text/javascript" src="js/dtree.js" ></SCRIPT>
<script type="text/javascript" src="js/fwk_service.js"></script>
<STYLE type="text/css" rel="stylesheet">
@import url( css/font.css );
@import url( css/menu.css );
@import url( css/style.css );
@import url( css/dtree.css );
.style1 {color: #CC0000}
</STYLE>
</HEAD>
<BODY>
<table cellspacing=0 cellpadding=0 width=100% border=0 style="PADDING-LEFT: 3px; PADDING-RIGHT: 3px;">
<tbody>
<tr>
<td valign=top width=100% height=65 ><?php include_once('header.php'); ?></td>
</tr>
<tr>
<td valign=top height=20><table cellspacing=0 cellpadding=0 width="100%" border=0>
<tbody>
<tr>
<td id=nav valign=top width=200 rowspan=2><?php include_once('left_nav.php'); ?></td>
<td width=3 height=1 bgcolor="#f1f1f1"><img src="images/spacer.gif" width="3" height="1"></td>
<td width="100%" height="450" rowspan=2 align="left" valign=top style="PADDING-LEFT: 3px; PADDING-RIGHT: 0px;"><?php include_once('program_title.php'); ?>
<br>
<form action="" method="post" name="frmmain" id="frmmain">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="25" colspan="2"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="left" scope="col"> </td>
</tr>
<tr bgcolor="#CCCCCC">
<td height="39" align="center" bgcolor="#F4F4F4" scope="col"><table width="95%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="left" scope="col"><button onClick="return ChkUpdate();" style="cursor:hand; width:105px; height:31px; cursor:hand">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><img src="images/icons/button-save.gif" width="100" height="26" border="0" /></td>
</tr>
</table>
</button>
<button type="reset" style="cursor:hand; width:105px; height:31px; cursor:hand">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><img src="images/icons/button-reset.gif" width="100" height="26" border="0" /></td>
</tr>
</table>
</button>
<button type="reset" style="cursor:hand; width:105px; height:31px; cursor:hand" onClick="Cancel()">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td><img src="images/icons/button-cancle.gif" width="100" height="26" border="0"></td>
</tr>
</table>
</button></td>
</tr>
</table></td>
</tr>
<tr>
<td scope="col"> </td>
</tr>
</table></td>
</tr>
<tr>
<td colspan="2" align="center"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="23" colspan="8" align="center" class="c3"><strong class="font-thai">รายงานปัญหา </strong></td>
</tr>
<tr>
<td height="20" align="right" class="c1" width="350"><strong class="font-thai">หมายเลขรายงานปัญหา : </strong>
<td height="20"class="c1" width="250">
<?=$row_rs_service['Id_ServiceRequest'];?>
<input type = "hidden" name = "Id_ServiceRequest" id = "Id_ServiceRequest" value = "<?php echo $row_rs_service['Id_ServiceRequest']; ?>">
<td height="20" align="right" class="c1" width="250"><span class="font-thai"><strong class="font-thai"><font color="#FF0000">ความเร่งด่วน</font></strong></span><strong class="font-thai"><span class="style1"> : </span></strong></td>
<td height="20" class="c1" width="250"><font color="#FF0000"><?=$row_rs_service['typeSpeed'];?></font></td>
<td height="20" class="c1" width="100"> </td>
<td height="20" class="c1" width="250"> </td>
<td height="20" class="c1" width="250"> </td>
<td height="20" class="c1"> </td>
</tr>
<tr>
<td height="20" align="right" class="c1" ><strong class="font-thai">ผู้แจ้งรายงานปัญหา : </strong>
<td height="20" class="c1"> <?=$row_rs_service['name_UserGeneral'];?>
<td height="20" align="right" class="c1"><strong class="font-thai">ตำแหน่ง : </strong>
<td height="20" class="c1"><?=$row_rs_service['name_Position'];?>
<td height="20" align="right" class="c1"><strong class="font-thai">แผนก : </strong>
<td height="20" class="c1"> <?=$row_rs_service['name_Agencies'];?>
<td height="20" class="c1"> </td>
<td height="20" class="c1"> </td>
</tr>
<tr>
<td height="20" align="right" class="c1"><strong class="font-thai" >เครื่องคอมพิวเตอร์ที่มีปัญหา : </strong>
<td height="20" class="c1"><?=$row_rs_service['Int_Computer'];?>
<td height="20" align="right" class="c1"><strong class="font-thai">ที่อยู่เครื่องคอมพิวเตอร์ : </strong>
<td height="20" class="c1"> <?=$row_rs_service['build_name'];?>
<td height="20" align="right" class="c1"><strong class="font-thai">ห้อง : </strong>
<td height="20" class="c1" > <?= $row_rs_service['name_Addresscom'];?>
<td height="20" class="c1"> </td>
<td height="20" class="c1"> </td></tr>
<tr>
<td height="20" align="right" class="c1"><span class="font-thai"><strong>วันที่แจ้งรายงานปัญหา</strong></span><strong> : </strong>
<td height="20" class="c1"><?=$row_rs_service['Date_ServiceRequest'];?>
<td height="20" align="right" class="c1"><span class="font-thai"><strong>เวลาที่แจ้งรายงานปัญหา</strong></span><strong> : </strong>
<td height="20" class="c1"><?=$row_rs_service['Time_ServiceRequest'];?>
<td height="20" class="c1" colspan="4"> </td>
</tr>
<tr >
<td height="20" align="right" class="c1" ><strong class="font-thai">รายละเอียดปัญหา : </strong>
<td height="20" class="c1" colspan="2"><?=$row_rs_service['Proble_ServiceRequest'];?>
<td height="20" class="c1" colspan="5"> </td>
</tr>
<tr>
<td height="23" colspan="8" align="center" class="c3"><strong class="font-thai">ส่วนของเจ้าหน้าที่สารสนเทศ </strong></td>
</tr>
<tr>
<? if($row_rs_service['type_ServiceRequest']==""){ ?>
<td height="20" align="right" class="c1"><strong class="font-thai">ประเภทงาน : </strong>
<td height="20" class="c1"><select name="choice" class="font-thai" onChange="this.form.submit();">
<option value="">กรุณาเลือกประเภทงาน</option>
<option value = "Hardware" <? if($_POST['choice'] == 'Hardware') { echo "selected"; } ?>>Hardware</option>
<option value = "Software" <? if($_POST['choice'] == 'Software') { echo "selected"; } ?>>Software</option>
</select>
</td>
<td height="20" align="right" class="c1" ><strong class="font-thai">ลักษณะงาน : </strong>
<td height="20" class="c1"><? echo"<select name='ListStyle' class='font-thai'>'
<option>กรุณาเลือกลักษณะงาน</option>";
$sql="SELECT * FROM tb_stylejob where typeService='".$_POST['choice']."'";
$result=mysql_query($sql);
while ($rs=mysql_fetch_array($result)){
$id_stylejob=$rs['Id_stylejob'];
$name_stylejob=$rs['name_stylejob'];
echo"<option value='$id_stylejob'>$name_stylejob</option>"; }
echo" </select>"; ?>
</td>
<? }else{ ?>
<td height="20" align="right" class="c1"><strong class="font-thai">ประเภทงาน : </strong>
<td height="20" class="c1" colspan="2"><?=$row_rs_service['type_ServiceRequest'];?>
<input type="hidden" name="choice" id="choice" value="<? $row_rs_service['type_ServiceRequest']?>">
<td height="20" align="right" class="c1" ><strong class="font-thai">ลักษณะงาน : </strong>
<td height="20" class="c1" colspan="2"><?=$row_rs_service['name_stylejob'];?>
<input type="hidden" name="ListStyle" id="ListStyle" value="<? $row_rs_service['Id_stylejob']?>">
<? }?>
<td height="20" class="c1" colspan="4"> </td>
</tr>
<tr>
<td height="20" align="right" class="c1" ><span class="font-thai"><strong>รายละเอียดการแก้ไขปัญหา :</strong></span><strong> </strong></td>
<td class="c1" colspan="5"><textarea name="Detail_ServiceRequest" rows="10" cols="50"><?=$row_rs_service['Detail_ServiceRequest'];?>
</textarea>
<td class="c1" colspan="2"> </td>
</tr>
<tr>
<td height="20" align="right" class="c1"><span class="font-thai"><strong>สถานะรายงานปัญหา</strong></span><strong> : </strong></td>
<td class="c1"><select name = "StatusRequest" class="font-thai" id = "build_name">
<option value = "ST0001" <? if($row_rs_service['Id_StatusRequest'] == "ST0001") { echo "selected"; }?>>ยังไม่ได้แก้ไข</option>
<option value = "ST0002" <? if($row_rs_service['Id_StatusRequest'] == "ST0002") { echo "selected"; }?>>กำลังแก้ไข</option>
<option value = "ST0003" <? if($row_rs_service['Id_StatusRequest'] == "ST0003") { echo "selected"; }?>>แก้ไขเรียบร้อยแล้ว</option>
</select>
<td height="20" class="c1" colspan="6"> </td>
</tr>
<tr>
<td height="20" class="c3" colspan="8"> </td>
</tr>
</table></td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
</table>
</form></td>
</tr>
<tr>
<td height=399 valign=top background="images/vline.gif"><img src="images/h1_.gif" width="8" height="100" id=ctrlMnu style="CURSOR: hand" onClick="ShowHidePanel('nav', 'ctrlMnu')" onMouseOver="this.style.filter='alpha(opacity=65);'" onMouseOut="this.style.filter='alpha(opacity=100);'"> </td>
</tr>
</tbody>
</table>
<?php include('footer.php'); ?>
</td>
</tr>
</tbody>
</table>
</BODY>
</HTML>
Tag : PHP, MySQL
|
|
|
|
|
|
Date :
2010-11-16 23:23:11 |
By :
SonakO |
View :
781 |
Reply :
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ไม่จำเป็นครับ แต่จะต้อง where key ให้ครบครับ
|
|
|
|
|
Date :
2010-11-17 06:29:28 |
By :
webmaster |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ขอบคุณนะค่ะ
|
|
|
|
|
Date :
2010-11-28 00:12:20 |
By :
SonakO |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 02
|