whiteboikyle Posted June 18, 2008 Share Posted June 18, 2008 Well i was trying to put all the usernames i get from the mysql query into an array.. Here is what i got so far.. but it doesn't work.. Any suggestions? $result = $config->query("SELECT * FROM members limit 20"); for ($i = 0; $i < mysql_num_rows($result); $i = $i + 1) { $name = mysql_result($result, $i, "username"); $id = mysql_result($result, $i, "id"); $username = array($name => $id); } echo $username['whitey']; Quote Link to comment Share on other sites More sharing options...
mmarif4u Posted June 18, 2008 Share Posted June 18, 2008 Did you tried while loop. Quote Link to comment 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.