Browse Source

del select dir_name

manto07m 3 years ago
parent
commit
09d24e9326
1 changed files with 4 additions and 4 deletions
  1. 4 4
      script/php/video_tools.php

+ 4 - 4
script/php/video_tools.php

@@ -16,9 +16,9 @@ sqlsrv_close($conn);
 
 function FindPath($root, $folder, $ffmpeg)
 {
-    $sql = "SELECT * FROM [BIMComponents].[dbo].[Video_Node] Where [dir_name] = '" . $folder . "';";
+    /*$sql = "SELECT * FROM [BIMComponents].[dbo].[Video_Node] Where [dir_name] = '" . $folder . "';";
     $fetchResult = sqlsrv_query($GLOBALS["conn"], $sql);
-    $row = sqlsrv_fetch_array($fetchResult, SQLSRV_FETCH_ASSOC);
+    $row = sqlsrv_fetch_array($fetchResult, SQLSRV_FETCH_ASSOC);*/
 
     $rootPath = $root . '/' . $folder;
     $paths = array_diff(scandir($root . '/' . $folder), array('.', '..', 'Thumbs.db'));
@@ -30,13 +30,13 @@ function FindPath($root, $folder, $ffmpeg)
                 echo ("<li data-jstree='{ " . '"type" : "file"' . " }' >");
                 $title = explode(".", $path)[0];
                 $file_path = substr($rootPath, 4) . "/" . $path;
-                $path = "title:" . $title . "path:" . $file_path . "  dir_id:" . $row["dir_name"];
+                $path = "title:" . $title . "path:" . $file_path . "  dir_id:" . $folder;
                 echo ($path);
                 echo ("</li>");
                 $sql = "BEGIN
                 IF NOT EXISTS (SELECT * FROM [BIMComponents].[dbo].[Video_Table] WHERE [file_path] = '" . $file_path . "')
                 BEGIN
-                    INSERT INTO [BIMComponents].[dbo].[Video_Table] ([title],[file_path],[file_name],[dir_name]) VALUES ('" . $title . "','" . $file_path . "','" . $title . "','" . $row["dir_name"] . "')
+                    INSERT INTO [BIMComponents].[dbo].[Video_Table] ([title],[file_path],[file_name],[dir_name]) VALUES ('" . $title . "','" . $file_path . "','" . $title . "','" . $folder . "')
                 END
              END";
                 $fetchResult = sqlsrv_query($GLOBALS["conn"], $sql);