Hi!
I have a database that I get playerdata from (soccer game). This SQL-query below returns 10 rows when quering the database through a MySQL client. If I do COUNT(*) in this query it returns 10 rows aswell, but when I loop through the results outputting them one by one, the first one doesn't get printed out, only 9 get printed out. Even if I change the order to descending the first one doesn't get printed (the one not printed with ascending order gets printed last here as it should). It's nothing wrong in the database, something goes wrong in the PHP-part. Or is it maybe a problem in PHP that I don't know of? Anyway, if you know whats wrong or how I can get around this annoying problem, please help me!
CODE
$getdata1 = mysql_query("select * from MATCHDATA_PLAYERS right join MATCHDATA_TEAM using (row_id) left join PLAYERDATA using (ID) where turn=$turn and type='S' and team_id=$id ORDER BY pos ASC");
$data1 = mysql_fetch_array($getdata1);
while($data1 = mysql_fetch_array($getdata1))
{
print "<table width='300' border='0' cellspacing='0' cellpadding='0'><tr><td width='30'><div align='center'>";
print $pos;
print "</div></td><td width='1' bgcolor='#000000'></td><td width='120'><div align='center'>";
print $data2['NAME'];
print "</div></td><td width='1' bgcolor='#000000'></td><td width='20'><div align='center'>";
print $data2['GRADE_NUM'];
print "</div></td><td width='1' bgcolor='#000000'></td><td width='50'><div align='center'>";
print $form;
print "</div></td><td width='1' bgcolor='#000000'></td><td width='70'><div align='right'>";
print $value;
print "</div></td></tr></table>";
}
Thanks
Vasse