if($_GET["name"] != "" AND $_GET["lastname"] != "")
{
$select = " SELECT * FROM allrecords WHERE branch = '$objResult[branch]' AND (name LIKE '%".$_GET["name"]."%' AND lastname LIKE '%".$_GET["lastname"]."%' ) ";
}
if($_GET["engine"] != "" )
{
$select = " SELECT * FROM allrecords WHERE branch = '$objResult[branch]' AND (engine LIKE '%".$_GET["engine"]."%' ";
}
if($_GET["company"] != "" )
{
$select = "SELECT * FROM allrecords WHERE branch = '$objResult[branch]' AND (company LIKE '%".$_GET["company"]."%' ";
}
$objConnect = mysql_connect("localhost","root","upxowffj") or die("ไม่สามารถติดต่อ HOST ได้");
$objDB = mysql_select_db("customer")or die("ติดต่อฐานข้อมูลไม่ได้");
// Search By name or lastname
$strSQL = "$select ";// ต้องการใช้เช็คค่าที่ค้นหาให้ตรงกับสาขาของ User นั้นๆด้วย (AND branch = ".$objResult['branch'].")OR (engine LIKE '%".$_GET["engine"]."%' OR company LIKE '%".$_GET["company"]."%' ) /*SELECT * FROM allrecords WHERE branch = '$objResult[branch]'*/