<?php
if (!empty($_REQUEST['term'])) {
$term = mysql_real_escape_string($oconn, $_REQUEST['term']);
//$sql = "SELECT * FROM ".TBL_PRODUCT." WHERE name LIKE '%".$term."%'";
$sql = "SELECT id,name,sub,best FROM ".TBL_PRODUCT." WHERE name LIKE '%".$term."%' AND `active`='Y' ORDER BY `name` ASC";
$r_query = mysql_query($oconn,$sql);
$num = mysql_num_rows($r_query);
if($num==0){
echo '<script language="javascript">';
echo 'alert("ไม่มีข้อมูลสินค้าที่ทำการค้นหา")';
echo '</script>';
}
while ($row2 = mysql_fetch_assoc($r_query)){
?>
<?php
if (!empty($_REQUEST['term'])) {
$term = mysql_real_escape_string( $_REQUEST['term']);
//$sql = "SELECT * FROM ".TBL_PRODUCT." WHERE name LIKE '%".$term."%'";
$sql = "SELECT id,name,sub,best FROM ".TBL_PRODUCT." WHERE name LIKE '%".$term."%' AND `active`='Y' ORDER BY `name` ASC";
$r_query = mysql_query($sql);
$num = mysql_num_rows($r_query);
if($num==0){
echo '<script language="javascript">';
echo 'alert("ไม่มีข้อมูลสินค้าที่ทำการค้นหา")';
echo '</script>';
}
while ($row2 = mysql_fetch_assoc($r_query)){
?>