Forum Moderators: coopster
It uses two while loops nested in side each other and also an if statement within the final while:
$pagesQuery=mysql_query("SELECT * FROM ******* ORDER BY ******** ASC");
$_SERVER['totalPagesNum']=mysql_num_rows($pagesQuery);
$linksQuery=mysql_query("SELECT * FROM ******* ORDER BY ******** ASC");
$_SERVER['linkedPagesTotal']=0;
$_SERVER['disabledPagesTotal']=0;
while($pagesData=mysql_fetch_array($pagesQuery)){
if($pagesData['page_disabled']==1){
$_SERVER['disabledPagesTotal']++;
}
while($linksData=mysql_fetch_array($linksQuery)){
if($pagesData['page_link_id']==$linksData['site_links_url']){
$_SERVER['linkedPagesTotal']++;
break; //Just added this in now allows for 3 executions max?
}
}
}
The issue is the if statement only gets executed once however the while does itterate through each of the links.
Ive a seperate query for each while loop.
Any ideas whats going wrong, its one of those W*F why wont it work moments after lots of good progress.
Is the mysql_num_rows function cuasing a prob?
TIA