try {
$keyword = trim($_GET["keyword"]);
if ($keyword <> "") {
$sql = "SELECT * FROM tbl_contacts WHERE 1 AND "
. " (first_name LIKE :keyword) ORDER BY first_name ";
$stmt = $DB->prepare($sql);
$stmt->bindValue(":keyword", $keyword."%");
} else {
$sql = "SELECT * FROM tbl_contacts WHERE 1 ORDER BY first_name ";
$stmt = $DB->prepare($sql);
}
我需要做多個搜索,以名字,姓氏,middle_name,contact_no1領域如何創建多個搜索?
問題是什麼? – Rizier123
在你的查詢中使用'OR'和多個bindValue – Roljhon