Jump to content

Select MySQL


duncan_cowan

Recommended Posts

  • 5 weeks later...

i have added this code to a page

<?phprequire 'protected/db_connect.php';$query = "SELECT * FROM armies ORDER BY strength DESC LIMIT 10";$result = mysql_query($query)	or		die("error couldnt execute query");echo "<table border='0'>			<tr>				<td><center><font color='#FFFFFF'>Name</td>				<td><center><font color='#FFFFFF'>Strength</td>		</tr>";while ( $row = mysql_fetch_array($result))	{		echo "<tr>";		echo "<td><center><font color='#FFFFFF'>" . $row['army name'] . "</td>";		  echo "<td><center><font color='#FFFFFF'>" . $row['strength'] . "</td>";		  echo "</tr>";	  }echo "</table>";?>

but when i run it it displays the numbers in this order: 9 7 7 6 5 4 3 2 1211why?

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...