floridaflatlander Posted July 25, 2013 Share Posted July 25, 2013 In the elseif below if the $group_num is in the $dont_print I don't want add the info, what am I doing wrong $dont_print = array(0, 12); foreach ($group_array as $key => $group_num) { if (!$add_on_sql) {$add_on_sql = 'WHERE id_group = '.$group_num.'';} elseif (in_array($group_num, $dont_print, FALSE)) {$add_on_sql .= ' OR id_group = '.$group_num.'';} } Thanks Link to comment https://forums.phpfreaks.com/topic/280502-returning-false-with-in_array/ Share on other sites More sharing options...
Muddy_Funster Posted July 25, 2013 Share Posted July 25, 2013 try elseif (!in_array($group_num, $dont_print)) {$add_on_sql .= ' OR id_group = '.$group_num.'';} Link to comment https://forums.phpfreaks.com/topic/280502-returning-false-with-in_array/#findComment-1442131 Share on other sites More sharing options...
floridaflatlander Posted July 25, 2013 Author Share Posted July 25, 2013 Okay I printed $q and found the problem, 12 the number I didn't want was first up in the loop and address in the if() not the elseif() Sorry about that Muddy_Funster and thanks Link to comment https://forums.phpfreaks.com/topic/280502-returning-false-with-in_array/#findComment-1442133 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.