$strSQL = "select `order`.order_ID,`order`.idcode_pb,`order`.order_generation,`order`.order_idcompany,`order`.order_date,`order`.order_project_ID,`order`.order_due_date,`order`.order_size,`order`.order_size_sum,`order`.order_detail,`order`.order_member,`order`.name_order,`order`.name,`order`.idmem,`order`.member_id,`order`.adate,`order`.status_up,`order`.check_status,`order`.status_order,`order`.orders,`order`.vate,`order`.money,`order`.company_general
,company_user.idcompany,company_user.compa_name
FROM `order` INNER JOIN company_user
ON company_user.idcompany = `order`.order_idcompany
WHERE company_user.compa_name LIKE '%".$_GET["txtKeyword"]."%'
or `order`.company_general LIKE '%".$_GET["txtKeyword"]."%' Group by `order`.idcode_pb DESC LIMIT 0,10 ";
Code (PHP)
`order`.company_general LIKE '%".$_GET["txtKeyword"]."%' // ค้นหาไม่เจอ!!
company_user.compa_name LIKE '%".$_GET["txtKeyword"]."%' // ค้นเจอ
$strSQL = "select `order`.order_ID,`order`.idcode_pb,`order`.order_generation,`order`.order_idcompany,`order`.order_date,`order`.order_project_ID,`order`.order_due_date,`order`.order_size,`order`.order_size_sum,`order`.order_detail,`order`.order_member,`order`.name_order,`order`.name,`order`.idmem,`order`.member_id,`order`.adate,`order`.status_up,`order`.check_status,`order`.status_order,`order`.orders,`order`.vate,`order`.money,`order`.company_general
,company_user.idcompany,company_user.compa_name
FROM `order` INNER JOIN company_user
WHERE `order`.company_general LIKE '%".$_GET["txtKeyword"]."%'
or company_user.compa_name LIKE '%".$_GET["txtKeyword"]."%' AND `order`.order_idcompany = company_user.idcompany Group by `order`.idcode_pb DESC LIMIT 0,10 ";