code
<?php
include("config.inc.php");
$result = mysql_query("select * from tb1") or die ("Error Can not to result") ;
$result1 = mysql_query("select N.f_id , N.dept_name , N.rs , N.sa , N.si , N.month , D.group , N.year FROM ntb2 N JOIN department D ON N.dept_id=D.dept_id ORDER BY D.group") or die ("Error Can not to result") ;
$dbarr = mysql_fetch_array($result) ;
$dbarr1 = mysql_fetch_array($result1) ;
?>