Jump to content

"while" not working


duncan_cowan

Recommended Posts

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...