I have a table that I am displaying a users current attack lvl and username in. In that table I also have have two columns that I want to display players exp and players rank.
The problem I am having is the players experience is in a different table and I don't know how to make another array to pull the players experience based on the username pulled from the first array. And also the rank can be achieved with the first array but I don't know how to make it display a ascending numeral for each loop.
<table align="center">
<tr>
<th colspan="4"><font color="#d3d3d3">Attack Leaders</th>
</tr>
<tr>
<th width="100"><font color="#d3d3d3">Rank</th>
<th width="100"><font color="#d3d3d3">Username</th>
<th width="100"><font color="#d3d3d3">Experience</th>
<th width="100"><font color="#d3d3d3">Level </th>
</tr>
<?php
$sql = "SELECT user, cur_attack FROM curstats order by cur_attack desc LIMIT 25";
$result = mysql_query($sql) or die(mysql_error());
$user = $cut_attack = array();
while($row = mysql_fetch_assoc($result)) {
$user[] = $row['user'];
$cur_attack[] = $row['cur_attack'];
?>
<tr>
<td align="center"><font color="#d3d3d3"></font></td>
<td align="center"><font color="#d3d3d3"><?php echo $row['user'];?></font></td>
<td align="center"><font color="#d3d3d3"></font></td>
<td align="center"><font color="#d3d3d3"><?php echo $row['cur_attack'];?></font> </td></tr>
<?php
}
?>
</table
Here is a link to the page as is now:
ok i wrote up the query the way you showed and now i get Column 'user' in field list is ambiguous
$sql = "SELECT user, cur_attack , experience.*
FROM curstats
LEFT JOIN experience
ON curstats.user = experience
order by cur_attack desc LIMIT 25";
$result = mysql_query($sql) or die(mysql_error());
$user = $cur_attack = $exp_attack = array();
while($row = mysql_fetch_assoc($result)) {
$user[] = $row['user'];
$cur_attack[] = $row['cur_attack'];
$exp_attack[] = $ROW['exp_attack'];
?>
<tr>
<td align="center"><font color="#d3d3d3"></font></td>
<td align="center"><font color="#d3d3d3"><?php echo $row['user'];?></font></td>
<td align="center"><font color="#d3d3d3"></font><?php echo $row['exp_attack']; ?></td>
<td align="center"><font color="#d3d3d3"><?php echo $row['cur_attack'];?></font> </td></tr>