List Menu / DropDownList 2 ชั้น odbc Error ไม่รู้ผิดตรงไหน ช่วยดูให้นะค่ะ
โค๊ด
Code (PHP)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>พิมพ์ แบบรายงาน</title>
<script language="JavaScript">
//function Dropdownlist(){
function dropdownlist(listindex)
{
document.form1.subcategory.options.length = 0; ///Edit Form Name
switch (listindex)
{
<?
$conn=odbc_connect("Driver={Client Access ODBC Driver (32-bit)};System=10.1.1.19;Uid=mvx;Pwd=mvx;","mvx","mvx");
$sql_= "select * from DATA.KCSTRN ";
$re_= odbc_exec($conn, $sql_) or die ("Error Execute [".$sql_."]");
while ($data_= odbc_fetch_array($re_)){
?>
case "<?=$data_['Z2ITNO']?>" :
<?
$sql_1= "select * from DATA.KCSTRN where Z2ITNO = $data_[Z2ITNO] ";
$re_1= odbc_exec($conn, $sql_1) or die ("Error Execute [".$sql_1."]");
$i=0;
while ($data_1= odbc_fetch_array($re_1)){ ///Edit Form Name
?>
document.form1.subcategory.options[<?=$i?>]=new Option("<?=$data_1['Z2BANO']?>");
<? $i++;
}?>
break;
<? }?>
}
return true;
}
</script>
</head>
<body>
<div class="navi_main">
<div class="bg">
<form id="form1" name="form1" method="GET" action="session_201k.php?C=$_SESSION['s_access']" onsubmit="return ValidateForm()" target="_blank">
<table width="380" height="200" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="35" colspan="3" align="center"><div style="margin:10px 0 0 10px;"><font size="4" color="#0000FF"><strong>พิมพ์ แบบ กศก. 20/1 ก. </strong></font></div></td>
</tr>
<tr>
<td colspan="3" align="center" valign="top"> </td>
</tr>
<tr>
<td align="center" valign="top"> </td>
<td align="left" valign="top"> </td>
<td align="left" valign="top">
<?
$sql="SELECT * FROM DATA.KCSTRN WHERE Z2TRTP LIKE '%R%' ";
$re=odbc_exec($conn, $sql) or die ("Error Execute [".$sql."]");
?>
</td>
</tr>
<tr class="cssContent">
<td align="left" width="635">
</td>
</tr>
<tr>
<td width="635" align="center" valign="top"></td>
<td width="21" align="left" valign="top"> </td>
<td width="769" align="left" valign="top">
<div class="text" style="margin:15px 0 0 10px;"><strong>รหัสบริษัท :</strong></div>
<div class="text" style="margin:10px 0 0 10px;">
<select name="category" id="category" onchange="javascript: dropdownlist(this.options[this.selectedIndex].value);">
<option value="">-- Select --</option>
<? while ($data=odbc_fetch_array($re)){?>
<option value="<?=$data['Z2ITNO']?>"><?=$data['Z2ITNO']?></option>
<? }?>
</select>
</div>
<div class="text" style="margin:15px 0 0 10px;"><strong>เอกสารเลขที่ :</strong></div>
<div class="text" style="margin:10px 0 0 10px;">
<script type="text/javascript" language="JavaScript">
document.write('<select name="subcategory" id="subcategory"><option value="">-- Select --</option></select>')
</script>
<noscript>
<select name="subcategory" id="subcategory" >
<option value="">-- Select --</option>
</select>
</noscript>
</div>
<?
odbc_close($conn);
?>
</td>
</tr>
</table>
</form>
</div>
</div>
<div class="footer">
</body>
</html>
พอลองตรวจสอบโค๊ดจาก Chrome on line 32
Code (PHP)
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>พิมพ์ แบบรายงาน</title>
<script language="JavaScript">
//function Dropdownlist(){
function dropdownlist(listindex)
{
document.form1.subcategory.options.length = 0; ///Edit Form Name
switch (listindex)
{
case "BCBCSQI108-0001" :
<br />
<b>Warning</b>: odbc_exec() [<a href='function.odbc-exec'>function.odbc-exec</a>]: SQL error: [IBM][System i Access ODBC Driver][DB2 for i5/OS]SQL0206 - Column BCBCSQI108 not in specified tables., SQL state S0022 in SQLExecDirect in <b>D:\AppServ\www\bar_code_number\form.php</b> on line <b>32</b><br />
Error Execute [select * from DATA.KCSTRN where Z2ITNO = BCBCSQI108-0001 ]</script></head><body></body></html>
Tag : PHP, MySQL, Ajax, jQuery, CakePHP
ประวัติการแก้ไข 2013-05-17 11:37:50 2013-05-17 11:38:25 2013-05-17 11:38:48 2013-05-17 11:40:17
Date :
2013-05-17 11:37:26
By :
kittipongw
View :
1237
Reply :
6
เหมือนว่าจัไม่ได้ระบุอ่าครับว่าคอลัมน์ BCBCSQI108 อยู่ในตารางอะไร (อ่านตามที่มันบอกอ่านะ)
Date :
2013-05-17 13:43:15
By :
itpcc
ใช้ Database : IBM AS400 ค่ะ
BCBCSQI108 not in specified table งงมากค่ะ
Date :
2013-05-17 13:48:18
By :
kittipongw
ขอบคุณมากๆ ค่ะ
Date :
2013-05-17 15:10:05
By :
kittipongw
Date :
2013-05-17 15:57:22
By :
mr.win
Load balance : Server 00