|
 |
|
ช่วยดูหั้ยหน่อยคับว่าผิดตรงไหน ไม่รู้มันผิดตรงไหนพอค้นหาข้อมูลแล้วมันไม่แสดงผลขึ้นมาให้คับ |
|
 |
|
|
 |
 |
|
ลองดูน่ะครับว่าได้หรือป่าว
และอีกอย่างน่ะครับการแสดงค่าที่ได้จากการ fetch ของ oracle ไม่เหมือนกัน mssql,mysql ครับ
มันใช้ $objResult["CREATED_NAME"] ไม่ได้ครับมันต่อง OCIResult($objParse,"CREATED_NAME") ครับ
<html>
<head>
<title>Mercury Material Transaction</title>
</head>
<body>
<center>
<?
$db = "(DESCRIPTION=(ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST =192.9.150.7)(PORT = 1521)))(CONNECT_DATA=(SID=vis)))";
$filter = "";
$c1 = OCILogon("apps","apps",$db);
if($_POST["transaction_date"]==""){
$filter .= "and transaction_date LIKE '".$_POST["transaction_date"]."' ";
}
if($_POST["item_number"]==""){
$filter .= " and item_number LIKE '".$_POST["item_number"]."' ";
}
if($_POST["item_description"]==""){
$filter .= " and item_description LIKE '".$_POST["item_description"]."' ";
}
if($_POST["transaction_type_name"]==""){
$filter .= " and transaction_type_name LIKE '".$_POST["transaction_type_name"]."' ";
}
if($_POST["subinventory_code"]==""){
$filter .= " and subinventory_code LIKE '".$_POST["subinventory_code"]."' ";
}
if($_POST["locator_name"]==""){
$filter .= " and locator_name LIKE '".$_POST["locator_name"]."' ";
}
if($_POST["transfer_subinventory"]==""){
$filter .= " and transfer_subinventory LIKE '".$_POST["transfer_subinventory"]."' ";
}
if($_POST["transfer_locator"]==""){
$filter .= " and transfer_locator LIKE '".$_POST["transfer_locator"]."' ";
}
if($_POST["transaction_reference"]==""){
$filter .= " and transaction_reference LIKE '".$_POST["transaction_reference"]."' ";
}
if($_POST["reason_name"]==""){
$filter .= " and reason_name LIKE '".$_POST["reason_name"]."' ";
}
if($_POST["creation_date"]==""){
$filter .= " and creation_date LIKE '".$_POST["creation_date"]."' ";
}
if($_POST["created_name"]==""){
$filter .= " and created_name LIKE '".$_POST["created_name"]."' ";
}
$strSQL ="SELECT * From pt_mercury_material_trans where (1=1) ".$filter."order by transaction_date , transaction_id";
$objParse = OCIParse($c1, $strSQL);
OCIExecute($objParse, OCI_DEFAULT) or die("Can't not execute statment");
?>
<table width="600" border="1">
<tr>
<td align="center">ID</td>
<td align="center">Txn. Date</td>
<td align="center">Item</td>
<td align="center">Description</td>
<td align="center">Txn.Type</td>
<td align="center">Subinv.</td>
<td align="center">Locator</td>
<td align="center">Transfer Subinv.</td>
<td align="center">Transfer Locator</td>
<td align="center">Reference</td>
<td align="center">Reason</td>
<td align="center">Creation Date</td>
<td align="center">Created Name</td>
</tr>
<?
while(OCIFetch($objParse)){
?>
<tr>
<td><a href="javascript:window.showModalDialog('test1.php?transaction_id=<?=OCIResult($objParse,"TRANSACTION_ID")?>' ,'','dialogWidth:1024px; dialogHeight:600px; status:no; center:yes ')"><?=OCIResult($objParse,"TRANSACTION_ID")?></a></td>
<td><?=OCIResult($objParse,"TRANSACTION_DATE")?></td>
<td><?=OCIResult($objParse,"ITEM_NUMBER")?></td>
<td><?=OCIResult($objParse,"ITEM_DESCRIPTION")?></td>
<td><?=OCIResult($objParse,"TRANSACTION_TYPE_NAME")?></td>
<td><?=OCIResult($objParse,"SUBINVENTORY_CODE")?></td>
<td><?=OCIResult($objParse,"LOCATOR_NAME")?></td>
<td><?=OCIResult($objParse,"TRANSFER_SUBINVENTORY")?></td>
<td><?=OCIResult($objParse,"TRANSFER_LOCATOR")?></td>
<td><?=OCIResult($objParse,"TRANSACTION_REFERENCE")?></td>
<td><?=OCIResult($objParse,"REASON_NAME")?></td>
<td><?=OCIResult($objParse,"CREATION_DATE")?></td>
<td><?=OCIResult($objParse,"CREATED_NAME")?></td>
</tr>
<?
}
?>
</table>
<?
ocilogoff($c1);
?>
</center>
</body>
</html>
|
 |
 |
 |
 |
Date :
2010-03-24 09:30:19 |
By :
windersun |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
มันก้อยังไม่แสดงผลออกมาอ่ะคับ
|
 |
 |
 |
 |
Date :
2010-03-24 09:43:00 |
By :
top |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ลอง echo $strSQL แล้วลองเอาไป run ใน sqlplus ดูครับว่าได้ค่ามาหรือป่าว
|
 |
 |
 |
 |
Date :
2010-03-24 09:50:33 |
By :
windersun |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
<html>
<head>
<title>Mercury Material Transaction</title>
</head>
<body>
<center>
<?
$db = "(DESCRIPTION=(ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST =192.9.150.7)(PORT = 1521)))(CONNECT_DATA=(SID=vis)))";
$filter = "";
$c1 = OCILogon("apps","apps",$db);
if($_POST["transaction_date"]==""){
$filter .= "and transaction_date LIKE '%".$_POST["transaction_date"]."%' ";
}
if($_POST["item_number"]==""){
$filter .= " and item_number LIKE '%".$_POST["item_number"]."%' ";
}
if($_POST["item_description"]==""){
$filter .= " and item_description LIKE '%".$_POST["item_description"]."%' ";
}
if($_POST["transaction_type_name"]==""){
$filter .= " and transaction_type_name LIKE '%".$_POST["transaction_type_name"]."%' ";
}
if($_POST["subinventory_code"]==""){
$filter .= " and subinventory_code LIKE '%".$_POST["subinventory_code"]."%' ";
}
if($_POST["locator_name"]==""){
$filter .= " and locator_name LIKE '%".$_POST["locator_name"]."%' ";
}
if($_POST["transfer_subinventory"]==""){
$filter .= " and transfer_subinventory LIKE '%".$_POST["transfer_subinventory"]."%' ";
}
if($_POST["transfer_locator"]==""){
$filter .= " and transfer_locator LIKE '%".$_POST["transfer_locator"]."%' ";
}
if($_POST["transaction_reference"]==""){
$filter .= " and transaction_reference LIKE '%".$_POST["transaction_reference"]."%' ";
}
if($_POST["reason_name"]==""){
$filter .= " and reason_name LIKE '%".$_POST["reason_name"]."%' ";
}
if($_POST["creation_date"]==""){
$filter .= " and creation_date LIKE '%".$_POST["creation_date"]."%' ";
}
if($_POST["created_name"]==""){
$filter .= " and created_name LIKE '%".$_POST["created_name"]."%' ";
}
$strSQL ="SELECT * From pt_mercury_material_trans where (1=1) ".$filter."order by transaction_date , transaction_id";
$objParse = OCIParse($c1, $strSQL);
OCIExecute($objParse, OCI_DEFAULT) or die("Can't not execute statment");
?>
<table width="600" border="1">
<tr>
<td align="center">ID</td>
<td align="center">Txn. Date</td>
<td align="center">Item</td>
<td align="center">Description</td>
<td align="center">Txn.Type</td>
<td align="center">Subinv.</td>
<td align="center">Locator</td>
<td align="center">Transfer Subinv.</td>
<td align="center">Transfer Locator</td>
<td align="center">Reference</td>
<td align="center">Reason</td>
<td align="center">Creation Date</td>
<td align="center">Created Name</td>
</tr>
<?
while(OCIFetch($objParse)){
?>
<tr>
<td><a href="javascript:window.showModalDialog('test1.php?transaction_id=<?=OCIResult($objParse,"TRANSACTION_ID")?>' ,'','dialogWidth:1024px; dialogHeight:600px; status:no; center:yes ')"><?=OCIResult($objParse,"TRANSACTION_ID")?></a></td>
<td><?=OCIResult($objParse,"TRANSACTION_DATE")?></td>
<td><?=OCIResult($objParse,"ITEM_NUMBER")?></td>
<td><?=OCIResult($objParse,"ITEM_DESCRIPTION")?></td>
<td><?=OCIResult($objParse,"TRANSACTION_TYPE_NAME")?></td>
<td><?=OCIResult($objParse,"SUBINVENTORY_CODE")?></td>
<td><?=OCIResult($objParse,"LOCATOR_NAME")?></td>
<td><?=OCIResult($objParse,"TRANSFER_SUBINVENTORY")?></td>
<td><?=OCIResult($objParse,"TRANSFER_LOCATOR")?></td>
<td><?=OCIResult($objParse,"TRANSACTION_REFERENCE")?></td>
<td><?=OCIResult($objParse,"REASON_NAME")?></td>
<td><?=OCIResult($objParse,"CREATION_DATE")?></td>
<td><?=OCIResult($objParse,"CREATED_NAME")?></td>
</tr>
<?
}
?>
</table>
<?
ocilogoff($c1);
?>
</center>
</body>
</html>
|
 |
 |
 |
 |
Date :
2010-03-24 09:59:29 |
By :
windersun |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
if($_POST["transaction_date"]==""){
$filter .= "and transaction_date LIKE '%'||".$_POST["transaction_date"]."||'%' ";
}
ลองใส่ ตัวเชื่อมประโยคดูครับ
|
 |
 |
 |
 |
Date :
2010-03-24 11:00:28 |
By :
exza_a |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
|
 |
 |
 |
 |
Date :
2010-03-24 11:05:20 |
By :
ll |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ลองแล้วไม่ได้คับมันขึ้น errorคับ
|
 |
 |
 |
 |
Date :
2010-03-24 15:25:24 |
By :
lukchang |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 03
|