duncan_cowan Posted February 17, 2007 Share Posted February 17, 2007 hi i am using the "while" function to echo the contents of the rows in a mysql table. unfortunatley only one row is being echoed.here is the script: $result_armies = mysql_query("SELECT * FROM armiesWHERE username = '".$username."'");while($row = mysql_fetch_array($result_armies)) { echo " <table border='0' background='images/logged-in/box.gif' align='center'> <tr> <td colspan='2'> <img src='images/logged-in/blank-short.gif' width='280'></td> </tr> <tr> <td><font size='2' face='font1' color='#FFFFFF'> Name:</font></td> <td><font size='2' face='font1' color='#FFFFFF'>".$row['army_name']."</font></td> </tr> <tr> <td><font size='2' face='font1' color='#FFFFFF'> Rank:</font></td> <td><font size='2' face='font1' color='#FFFFFF'>".$row['army_rank']."</font></td> </tr> <tr> <td><font size='2' face='font1' color='#FFFFFF'> Strength:</font></td> <td><font size='2' face='font1' color='#FFFFFF'>".$row['strength']."</font></td> </tr> <tr> <td colspan='2'><img src='images/logged-in/boxend.gif' alt='' width='280'></td> </tr> </table> "; } what is wrongthanks Link to comment Share on other sites More sharing options...
jlhaslip Posted February 17, 2007 Share Posted February 17, 2007 Have you verified that the Query is finding more than one set of values by using phpadmin or some other softwares? Link to comment Share on other sites More sharing options...
duncan_cowan Posted February 17, 2007 Author Share Posted February 17, 2007 do not worry i have solved it was the other part of the script that was the problem. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now