I'm creating a table with data from two queries and tried to connect them in a table. Tried using something like this :
$counter = 1;
echo '<table border="0" cellpadding="0" cellspacing="3"><tr>
<td width="10%">Miejsce</td>
<td width="25%">Nick</td>
<td width="20%">SteamID</td>
<td width="20%">Punkty</td>
</tr>';
while($row = mysql_fetch_array($skill_b) AND $row2 = mysql_fetch_array($sid_b))
{
echo '<tr class="select">';
echo '<td>'.$counter.'</td>';
echo '<td><center>'.$row['lastName'].'</center></td>';
echo '<td><center>'.$row2['uniqueId'].'</center></td>';
echo '<td><center>'.$row['skill'].'</center></td>';
echo '</tr>
$counter++;
}
echo '</table>';
and
$counter = 1;
echo '<table border="0" cellpadding="0" cellspacing="3"><tr>
<td width="10%">Miejsce</td>
<td width="25%">Nick</td>
<td width="20%">SteamID</td>
<td width="20%">Punkty</td>
</tr>';
echo '<tr class="select">';
echo '<td>'.$counter.'</td>';
while($row = mysql_fetch_array($skill_b))
{
echo '<td>'.$row['lastName'].'</td>';
}
while($row2 = mysql_fetch_array($sid_b))
{
echo '<td>'.$row2['uniqueId'].'</td>';
}
while($row3 = mysql_fetch_array($skill_b))
{
echo '<td>'.$row3['skill'].'</td>';
}
$counter++;
echo '</table>';
The second one kinda works I think, although it crashes the whole table, so I can't see all the results.
Query looks like this if there's something that can be changed in them :
$query_skill = sprintf(
"SELECT skill, lastName
From hlstats_Players
ORDER BY skill DESC
LIMIT 10");
$skill_b = mysql_query($query_skill);
$skill = mysql_result( $skill_b, -1 );
$query_sid = sprintf(
"SELECT uniqueId
From hlstats_PlayerUniqueIds
WHERE playerId='$pid_b'"
);
$sid_b = mysql_query($query_sid);
$sid = mysql_result( $sid_b, 0 );