Hello everyone,
Here's the code I want to solve:
Code:
<?php
	$result = mysql_query("SELECT id, uid, name, amount FROM lists WHERE uid = '$id' ORDER BY id DESC LIMIT 5");
	$i = 1;
	while ($row = mysql_fetch_assoc($result)) { ?>
	<ul id='list'>
		<li>
		<?php
			echo "<div class='num'>",$i++,"</div>";
			echo "<div class='name'>",$row['name'],"</div>";
			echo "<div class='amount'>",$row['amount'],"</div>";
		?>
		</li>
	</ul>
<?php } ?>
It displays as below:
Code:
Items	Name	Amount
2		A		1
4		B		6
6		C		10
I want it to be displayed like this:
Code:
Items	Name	Amount
1		A		1
2		B		6
3		C		10
Thank you,