execute a student query where module is the current one怎么表达?

execute a student query where module is the current one怎么表达?

这段话怎么用php表达
execute module query
loop through modules
display module
execute a student query where module is the current one
loop through students
display students
end loop
end loop

只是一段英文啊。我也不知道怎么和php联系在一起。
如履薄冰

DAL:
      execute module query
        loop through modules
          display module
          execute a student query where module is the current one
          loop through students
           display students
          end loop
      end loop
CODE:

[复制到剪切板]
CODE:
//$Db  Data Source

         
$Result $Db->Query('Module Query');
         
$Rs $Result->fetch();
         foreach(
$Rs as $R){
                echo 
$R["ModuleFields"];
                
$Result_Student $Db->Query('Student Query Where Student.Id='.$R['Id']);
                
$Rs_Student $Result_Student->fetch();
                foreach(
$Rs_Student as $Rss){
                    echo 
$Rss["student Fields"];
                }
         }
         
$Db->Free(); ;

你这段DAL有问题,效率不高,为何在Module Query里面不执行Join?数据库多次查询,是个很坏的习惯~!!

这个编辑器不支持tap,郁闷,搞的我打代码都在Editplus,然后Copy过来,倒~~~~~

('Student Query Where Student.Id='.$R['Id']);
怎么写?

建议楼主看看php入门~~~
这句怎么写还要贴吗?你干脆问:我上头交代下来的程序不会做,谁来帮我做做啊~~

郁闷

强烈建议实事求是,不懂的问题,自己想考虑个两小时,查个一小子资料,在来问