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 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 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. Link to comment https://forums.phpfreaks.com/topic/210662-in_array/#findComment-1098994 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.