複数の列で用語を検索するにはどうすればよいですか:title
、content
。例えば:
$searchTerm = 'android';
SELECT * FROM posts WHERE `title` OR `content` contains $SearchTerm
SELECT
*
FROM
posts
WHERE
lower(`title`) LIKE '%android%'
OR lower(`content`) LIKE '%android%'
SELECT *
FROM posts
WHERE
`title` LIKE '%android%'
OR `content` LIKE '%android%'
$sql = "SELECT * FROM posts WHERE `title` LIKE '%$SearchTerm%' OR `content` LIKE '%$SearchTerm%'";