MstrGmrDLP Posted June 4, 2014 Share Posted June 4, 2014 Okay, I had a similar problem before. $users = mysql_query("SELECT * FROM users"); while($users = mysql_fetch_assoc($users)){ echo "<tr><td><p><a href='users.php?id={$users['user_id']}'>{$users['user_name']}</a></p></td><td>{$users['user_clan']}</td><td>{$users['troop_donations']}</td></tr>"; } Quote Link to comment https://forums.phpfreaks.com/topic/288971-mysql_fetch_assoc-only-returning-1-value-instead-of-all-of-them/ Share on other sites More sharing options...
Solution fastsol Posted June 4, 2014 Solution Share Posted June 4, 2014 Try changing the $users in the while loop to something else, I think it's overwritting the $users from the query after the first loop while($row = mysql_fetch_assoc($users)){ echo "<tr><td><p><a href='users.php?id={$row['user_id']}'>{$row['user_name']}</a></p></td><td>{$row['user_clan']}</td><td>{$row['troop_donations']}</td></tr>"; } Quote Link to comment https://forums.phpfreaks.com/topic/288971-mysql_fetch_assoc-only-returning-1-value-instead-of-all-of-them/#findComment-1481814 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.