I am loading my navigation from a mysql table. i have two fields in my "nav" table subid and linkcaption. I am using this code
for($counter = 1; $counter <= 10; $counter = $counter + 1)
{
$result = @("select linkcaption from nav where subid='1$counter'");
$row = mysql_fetch_array($result);
$caption=$row['linkcaption'];
echo ("<tr><td><a href='index.php?p=1$counter'>$caption</a></td></tr>");
}
The question is that if it is ok with query to be called every time the for loop is triggered ( i think it will slow down the page). Is there any method i can do this in a better manner