Cod: Selectaţi tot
function judete2() // extrage judetele simplu
{
connect_db();
$coloane = 5;
$counter = 0;
echo'<tr>';
$query = mysql_query("SELECT * FROM judete");
while ($rand = mysql_fetch_array($query))
{
$counter++;
if ($counter > $coloane)
{
echo '</tr><tr>';
$counter = 0;
}
echo'<td valign="top" width="100"><a href="'.strtolower($rand['judet']).'.html">'.$rand['judet'].'</a><br></td>';
}
echo'</tr>';
}
Scriptul extrage din sql cele 42 de judete, vroiam pe mai multe coloane.
N-am inteles de ce $counter++ nu da 42.
Imi da ca in imaginea asta: http://img16.imageshack.us/my.php?image=capture1hug.jpg
deci nu arata tocmai cum trebuie.