Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想排除这些具有以下名称的专辑:
$ban_album_names = array('Wall', 'Profile', 'Cover', 'Instagram');
如何正确书写,
SELECT * FROM albums WHERE name NOT IN ???
我怎样才能让它在数组中查找,如果名称匹配它应该!= 行
试试这个:
$sql = "SELECT * FROM albums WHERE name NOT IN ( '" . implode( "', '" , $ban_album_names ) . "' )";
MySQL代码是
SELECT * FROM albums WHERE name NOT IN ('Wall', 'Profile', 'Cover', 'Instagram')