如何使用LIKE搜索3列?
以下代码给出错误
$sql .= " AND (Genre, Genre2, Genre3) like '%$s2%'";
完整的sql;
SELECT * FROM films where Title_ing like '%$s1%' OR Title_de like '%$s1%' AND (Genre like '%$s2%' OR Genre2 '%$s2%' OR Genre3 '%$s2%') AND imdbRating like '$s3%'
答案 0 :(得分:1)
您需要使用OR
AND (Genre like '%$genre%' OR Genre2 '%$genre%' OR Genre3 '%$genre%');