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')