|
|
|
รบกวนดูโค้ด ให้หน่อยครับ เลือก list menu แล้วขึ้น error |
|
|
|
|
|
|
|
ถ้าเลือก all ไม่ error ครับ แต่ถ้าเลือก001,002ใน list menu จะ error ไม่ทราบว่าโค้ดผิดตรงไหน พอดีเอาโค้ดพี่ win มาดัดแปลง รบกวนด้วยครับ
Code (PHP)
<html>
<head>
<meta http-equiv="Content-Language" content="th">
<meta http-equiv="content-Type" content="text/html; charset=window-874"><!-- ãËéáÊ´§ÀÒÉÒä·Â -->
<meta http-equiv="content-Type" content="text/html; charset=tis-620">
<title>ÃÒª×èÍ</title>
<meta http-equiv=Content-Type content="text/html; charset=tis-620">
<STYLE type=text/css>
A:link {COLOR: #0000FF; TEXT-DECORATION: none}
A:visited {COLOR: #660000; TEXT-DECORATION: none}
A:hover {COLOR: #FF0000; TEXT-DECORATION: underline}
</STYLE>
</head>
<body text='#3300FF' bgcolor="#CC99FF">
<center><H2>**</H></center>
<CENTER>
<form name="frmSearch" method="post" action="<?=$_SERVER['SCRIPT_NAME'];?>">
<table width="500" border="1" bordercolor='#FFFFFF'>
<tr>
<th bgcolor='#33FF00'>¡ÃسÒàÅ×Í¡
<input type="hidden" name="Action" value="Search">
<select name="ddlward" id="ddlward">
<option value="">all</option>
<option value="51">001</option>
<option value="52">002</option>
</select>
<input type="submit" value="¤é¹ËÒ"></th>
</tr>
</table>
</form>
<?
if($_POST["Action"] == "Search")
{
$objConnect = mysql_connect("192.168.2.24","sa","sa") or die("Error Connect to Database");
mysql_query("SET NAMES TIS620");
$objDB = mysql_select_db("hos");
$strSQL = "select ipt.*,iptadm.bedno,iptadm.bedtype,roomno.name,iptadm.roomno,concat(patient.pname,patient.fname,' ',patient.lname),aa.income as income,dt.name,aa.admdate,aa.age_y,aa.age_m,aa.age_d,aa.paid_money , aa.rcpt_money, aa.paid_money-aa.rcpt_money,aa.rcpt_money from ipt left outer join iptadm on iptadm.an=ipt.an left outer join patient on patient.hn=ipt.hn left outer join doctor dt on dt.code = ipt.admdoctor left outer join roomno on roomno.roomno=iptadm.roomno left outer join an_stat aa on aa.an=ipt.an left outer join ward w on w.ward = ipt.ward where ipt.dchstts is null ";
if($_POST["ddlward"] != "")
{
$strSQL .= " AND (ward = '".$_POST["ddlward"]."') ";
}
$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
?>
<table width="300" border="1" bordercolor='#CC99FF' bgcolor=''>
<tr bgcolor='#CCCC66'>
<th >ª×èÍ</th>
<th >Ê¡ØÅ</th>
</tr>
<?
while($objResult = mysql_fetch_array($objQuery))
{
?>
<tr bgcolor='#99FF99'>
<td><div align="center"><?=$objResult["an"];?></div></td>
<td><div align="center"><?=$objResult["hn"];?></div></td><a>
</tr>
<?
}
?>
</table>
<?
mysql_close($objConnect);
}
?>
</CENTER><br>
</body>
</html>
Tag : PHP, MySQL
|
|
|
|
|
|
Date :
2013-01-31 12:22:49 |
By :
Beer_7 |
View :
856 |
Reply :
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ลองเปลี่ยนไปเป็น
Code (PHP)
mysql_query($strSQL) or die (mysql_error());
|
|
|
|
|
Date :
2013-01-31 12:49:21 |
By :
mr.win |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ยังไม่ได้ครับ ขึ้นแบบนี้ครับ.
|
|
|
|
|
Date :
2013-01-31 15:25:54 |
By :
Beer_7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 02
|