KingOfHeart Posted August 13, 2010 Share Posted August 13, 2010 How do I use this function in a MYSQL search, and I don't want to use a JOIN command. $ignore = array(82,11,75,95); Select * FROM {$db_prefix}messages Where !in_array(ID_BOARD,$ignore) Order BY posterTime Desc Limit 300 Quote Link to comment https://forums.phpfreaks.com/topic/210662-in_array/ Share on other sites More sharing options...
kickstart Posted August 13, 2010 Share Posted August 13, 2010 Hi If building it up in php then try this:- $ignore = array(82,11,75,95); $sql = "Select * FROM {$db_prefix}messages Where ID_BOARD NOT IN (".implode(',',$ignore).") Order BY posterTime Desc Limit 300"; All the best Keith Quote Link to comment https://forums.phpfreaks.com/topic/210662-in_array/#findComment-1098946 Share on other sites More sharing options...
fenway Posted August 13, 2010 Share Posted August 13, 2010 FIND_IN_SET() does this too, if it's comma-separated. Quote Link to comment https://forums.phpfreaks.com/topic/210662-in_array/#findComment-1098994 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.