<?php include_once("../../function/ad_std.php"); header("content-type:text/plain; charset=tis-620"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); // เชื่อมต่อฐานข้อมูล // $q = iconv('utf-8','tis-620',$_GET["q"]); $q = "ว"; //$q = urldecode($_GET["q"]); /*$pagesize = 50; // จำนวนรายการที่ต้องการแสดง $table_db="article"; // ตารางที่ต้องการค้นหา $find_field="arti_topic"; // ฟิลที่ต้องการค้นหา $sql = "select * from $table_db where locate('$q', $find_field) > 0 order by locate('$q', $find_field), $find_field limit $pagesize"; $results = mysql_query($sql);*/ $resultEvent=show_districtAU($q); While( $row= mysql_fetch_array($resultEvent) ) { $id = $row['district_id']; // ฟิลที่ต้องการส่งค่ากลับ $name = ucwords( strtolower( $row['district_name'] ) ); // ฟิลที่ต้องการแสดงค่า // ป้องกันเครื่องหมาย ' $name = str_replace("'", "'", $name); // กำหนดตัวหนาให้กับคำที่มีการพิมพ์ $display_name = preg_replace("/(" . $q . ")/i", "<b>$1</b>", $name); echo "<li onselect=\"this.setText('$name').setValue('$id');\">$display_name</li>"; } mysql_close(); ?>