先遍历Favorites,判断如果是目录,得到目录名写进A表,如果是文件,写进B表
function dirtree($path=".") {
  $d = dir($path);
  while(false !== ($v = $d->read())) {
    if($v == "." || $v == "..")
      continue;
    $file = $d->path."/".$v;
        $m_name=$path.$v;
        if(is_dir($file)){
           dirtree($file);
           /**insert into tablea**/
      }else{
          /** insert into tableb
      }
  }
  $d->close();}