0

複数の列で用語を検索するにはどうすればよいですか:titlecontent。例えば:

$searchTerm = 'android';

SELECT * FROM posts WHERE `title` OR `content` contains $SearchTerm
4

3 に答える 3

1
SELECT 
  *
FROM 
  posts
WHERE
  lower(`title`) LIKE '%android%'
  OR lower(`content`) LIKE '%android%'
于 2012-04-09T10:30:34.070 に答える
0
SELECT *
FROM posts
WHERE
   `title` LIKE '%android%'
OR `content` LIKE '%android%'
于 2012-04-09T10:28:00.283 に答える
0
$sql = "SELECT * FROM posts WHERE `title` LIKE '%$SearchTerm%' OR `content` LIKE '%$SearchTerm%'";
于 2012-04-09T10:28:18.280 に答える