Hi all, I'm trying to show a 8 rows result into a HTML table made of 4 rows...it's the teams positions of a fantasy league
this is what I would receive:
1 MAY 28 5 WEN 15
2 PAN 24 6 BNE 12
3 BMA 20 7 BRE 10
4 PIL 16 8 CAM 4
consider that I'm very new to this and I'm trying to work it out but this is the result:
1 MAY 28 5 WEN 15
1 MAY 28 6 BNE 12
1 MAY 28 7 BRE 10
1 MAY 28 8 CAM 4
that means that the 2nd part of the query is correct, the sens is correct but the first part return only the first team and echo it 4 times...
and this is the code:
<?PHP
$db = mysql_connect("localhost", "fantalimbo", "") or die("Problem connecting");
mysql_select_db("fantalimbo_it_db",$db)or die("Problem selecting database");
$result1 = mysql_query("SELECT FROM classifica1 LIMIT 0,4",$db);
$result2 = mysql_query("SELECT FROM classifica1 LIMIT 4,4",$db);
echo "<TABLE>\n";
while($myrow1 = mysql_fetch_array($result1))
while($myrow2 = mysql_fetch_array($result2))
{
$pos1 = $myrow1["pos"];
$squadra1 = $myrow1["squadra"];
$punti1 = $myrow1["punti"];
$pos2 = $myrow2["pos"];
$squadra2 = $myrow2["squadra"];
$punti2 = $myrow2["punti"];
echo "<TR>\n";
echo "<TD>\n";
echo "<font face=ARIAL size=-1><B>$pos1</B></font>\n";
echo "</TD>\n";
echo "<TD>\n";
echo "<font face=ARIAL size=-1><B>$squadra1</B></font>\n";
echo "</TD>\n";
echo "<TD>\n";
echo "<font face=ARIAL size=-1><B>$punti1</B></font>\n";
echo "</TD>\n";
echo "<TD>\n";
echo "<font face=ARIAL size=-1><B>$pos2</B></font>\n";
echo "</TD>\n";
echo "<TD>\n";
echo "<font face=ARIAL size=-1><B>$squadra2</B></font>\n";
echo "</TD>\n";
echo "<TD>\n";
echo "<font face=ARIAL size=-1><B>$punti2</B></font>\n";
echo "</TD>\n";
}
echo "</TABLE>\n";
?>
</BODY>
</HTML>
for sure there is a better way to handle but since the important thing is to learn....I thought to do it in the way I was able to.....
thanx for your help
Roberto