Hello
I have this code:Works fine and does what I want, except this part:
Its fine when there is only 1 IP, but when there are several IPs I need a space between each IP.
The output now:
What I want:
I have this code:
Code:
// Bots list $sql = 'SELECT COUNT(group_id) AS total_botsFROM ' . USERS_TABLE . 'WHERE group_id = 6ORDER BY username';$result = $this->db->sql_query($sql);$total_bots = (int) $this->db->sql_fetchfield('total_bots');$this->db->sql_freeresult($result);$this->template->assign_vars(array('TOTAL_BOTS'=> $total_bots,));$sql = 'SELECT bot_id, bot_name, bot_agent, bot_ip, user_idFROM ' . BOTS_TABLE . 'ORDER BY bot_id ASC';$result = $this->db->sql_query($sql);$last_bots = array();while ($row = $this->db->sql_fetchrow($result)){$last_bots[] = $row;}$this->db->sql_freeresult($result);foreach ($last_bots as $row){$this->template->assign_block_vars('bots_list', array('BOT_ID'=> $row['bot_id'],'BOT_NAME'=> $row['bot_name'],'BOT_AGENT'=> $row['bot_agent'],'BOT_IP'=> $row['bot_ip'],'USER_ID'=> $row['user_id'],));}
'BOT_IP'=> $row['bot_ip'],
Its fine when there is only 1 IP, but when there are several IPs I need a space between each IP.
The output now:
204.187.14.73,204.187.14.74,204.187.14.75
What I want:
204.187.14.73, 204.187.14.74, 204.187.14.75
Statistics: Posted by Stoker 4.0 — Wed Apr 09, 2025 1:14 pm