Hi there. 🙂
I'm currently trying to achieve as the title says.
I've got a query which will bounce back 2+ results and I need the results to show up next to one another seperated by a comma.
This is the code I've got so far, which fails to achieve what I want...mostly guess work from me.
$sql = " SELECT character_name , character_id FROM character_table
WHERE character_guild_rank = '$guilds_member_rank' ";
if( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not query Guild table for member rank', '', __LINE__, __FILE__, $sql);
}
if($rank_guild_members = $db->sql_fetchrow($result))
{
$i = 0;
do
{
$character_id = $rank_guild_members['character_id'];
$members_list = "".$rank_guild_members[$i]['character_name'].", ";
$template->assign_block_vars('guilds_ranks.rows', array(
"U_GUILD_MEMBERS" => $members_list,
));
$i++;
}
while ( $rank_guild_members = $db->sql_fetchrow($result) );
}
It grabs the results fine, because echoing the character_id brings back what I would expect but I cannot work out how to output the values as I need them.
I need it to output the results to look like this:
Tom, Dick, Harry
Any help would be great!. :p 🙂