<html> <head> <title></title> </head> <body> <form name="frmSearch" method="get" action="<?php echo $_SERVER['SCRIPT_NAME'];?>"> <table width="599" border="1"> <tr> <th>Keyword <input name="txtKeyword" type="text" id="txtKeyword"> <input type="submit" value="Search"></th> </tr> </table> </form> <?php $txtKeyword = isset($_GET["txtKeyword"]) ? $_GET["txtKeyword"] : ''; if(empty($_POST["txtKeyword"])&&empty($_GET["txtKeyword"])){ $txtKeyword="";} else if(empty($_POST["txtKeyword"])&&!empty($_GET["txtKeyword"])){ $txtKeyword=$_GET["txtKeyword"]; } else{ $txtKeyword=$_POST["txtKeyword"]; } if($txtKeyword!="") { $objConnect = oci_connect("scotest", "scotest","10.0.0.98:1521/coopdata",'UTF8'); $strSQL = "SELECT * FROM mbmembmaster WHERE member_no LIKE '%$txtKeyword%' "; $objParse = oci_parse ($objConnect, $strSQL); oci_execute ($objParse); $objResult = oci_fetch_array($objParse,OCI_BOTH); echo $strSQL; ?> <table width="600" border="1"> <tr> <th width="91" align="center"> เลขสมาชิก</th> <th width="98" align="center"> ชื่อ - นามสกุล </th> <th width="198" align="center"> เลขบัตรประชาชน </th> <th width="97" align="center"> CountryCode </th> <th width="59" align="center"> Budget </th> <th width="71" align="center"> Used </th> </tr> <?php while($objResult = oci_fetch_array($objParse,OCI_BOTH)) { ?> <tr> <td><?php echo $objResult["member_no"]; ?> </td> <td><?php echo $objResult["memb_name"];?></td> <td><?php echo $objResult["memb_name"];?></td> <td><?php echo $objResult["memb_name"];?></td> <td><?php echo $objResult["memb_name"];?></td> <td><?php echo $objResult["memb_name"];?></td> </tr> <?php } ?> </table> <?php oci_close($objConnect); } ?> </body> </html>
while($objResult = oci_fetch_array($objParse,OCI_BOTH)) { die( print_r($objResult, true)); // เพิ่มบันทัดนี้ แล้วดูว่า มีตัวแปรตามการอ้างอิงหรือไม่ ?> <tr>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง