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']; Link to comment https://forums.phpfreaks.com/topic/110696-mysql-usernames-in-an-array/ Share on other sites More sharing options...
mmarif4u Posted June 18, 2008 Share Posted June 18, 2008 Did you tried while loop. Link to comment https://forums.phpfreaks.com/topic/110696-mysql-usernames-in-an-array/#findComment-567914 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.