Monkuar Posted December 14, 2011 Share Posted December 14, 2011 $DB->query("SELECT tid FROM reports WHERE id IN ($ids)"); while ($max = $DB->fetch_row()){ echo $max['tid']; } This code spits out: 12012167 It's grabbing 120, and 121 and 67. Those are my "tid" for each column in my database "reports" The problem I am trying to make it echo 120,121,67 So I use the explode: $tids = explode(",", $max['tid']); echo $tids; Then it echo's out. ArrayArrayArray Any idea guys? Quote Link to comment https://forums.phpfreaks.com/topic/253138-php-implode-is-not-working/ Share on other sites More sharing options...
litebearer Posted December 14, 2011 Share Posted December 14, 2011 foggy idea/hint... what happens if you change this echo $max['tid']; to this echo $max['tid'] . "<br>"; Quote Link to comment https://forums.phpfreaks.com/topic/253138-php-implode-is-not-working/#findComment-1297735 Share on other sites More sharing options...
Monkuar Posted December 14, 2011 Author Share Posted December 14, 2011 foggy idea/hint... what happens if you change this echo $max['tid']; to this echo $max['tid'] . "<br>"; $DB->query("SELECT tid FROM reports WHERE id IN ($ids)"); $arr = array(); while ($max = $DB->fetch_row()){ $arr[] = $max['tid']; } echo implode(',', $arr); Topic Resolved! Quote Link to comment https://forums.phpfreaks.com/topic/253138-php-implode-is-not-working/#findComment-1297736 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.