(V databaze je iba 500 zaznamov ale kontroluje vsetky)
Kód: Vybrať všetko
echo'<table border="0" cellpadding="2" cellspacing="0">';
$pocet=0;
for($i=-40;$i<=40;$i++){
echo'<tr>';
for($j=-40;$j<=40;$j++){
$databaza=mysql_fetch_assoc(mysql_query("select typ from mojatabulka where x='".$i."' and y='".$j."'"));
$typ=$databaza['typ'];
if ($typ==1){
echo'<td bgcolor="000000">';
}else{
echo'<td bgcolor="90DB75">';
}
echo'</td>';
}
echo'</tr>';
}
echo'</table>';