slyte33 Posted April 2, 2010 Share Posted April 2, 2010 Ok so take a look at this: $playersquery=$db->execute("select * from all_players"); $players=$playersquery->fetchrow(); $members=explode(",",$players['all_player_names']); $size=count($members); for($i=0;$i<=$size;$i++) { $user[$i] = $db->GetOne("select name from players where id=$members[$i]"); echo $user[$i][name]; echo "<br>"; } Let's say I have a 'all_players' table with the field 'all_player_names'(text) And let's also say that 'all_player_names' has this in it: 1,2,3 Then in the 'players' table there would be this: ID|NAME 1|Jamie 2|Stephanie 3|Alex So if 'all_player_names' has '1,2,3' in it, the top code above should display: Jamie Stephanie Alex ... but theres a problem. It only displays the first letter's of their names. So the output of it is this: J S A I'm pretty sure I had it right when I made it, but I still can't seem to find out why only 1 letter of the string is displayed. All help would be much much appreciated and I hope I explained what I am trying to do pretty well Thanks! Link to comment https://forums.phpfreaks.com/topic/197364-storing-a-valueconcat-seperated-by-a-comma-then-getting-data/ Share on other sites More sharing options...
slyte33 Posted April 2, 2010 Author Share Posted April 2, 2010 Anyone have an idea :-\ Link to comment https://forums.phpfreaks.com/topic/197364-storing-a-valueconcat-seperated-by-a-comma-then-getting-data/#findComment-1035964 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.