未分類

Class 目錄分類

function fun_class($sum,$c_class){
		$class = array();
    	$query = "SELECT * FROM tb_class WHERE c_sn = $c_class";
		$result=mysql_query($query);
		$loop = @mysql_num_rows($result);
        for ($i=0;$i<$loop;$i++){
            $row = mysql_fetch_assoc($result);
			// 把 c_sn , c_name 寫入Array
			array_push($class,array('c_sn'=>$row[c_sn],'c_name'=>$row[c_name],'c_show'=>$row[c_show]));
            $id = $row['c_class'];
            fun_class($sum,$id);
        }
		foreach($class as $key) 
   { 
    //解出array
	if($key[c_show] ==0) {
    echo "".$key[c_name]." / ";
						}
   }
    }