Backup and Restore: Added support for views (@oakstreet1)
[fa-stable.git] / includes / db / connect_db.inc
index b671945ab6e83daf6b9fe7ab8102a6d643c07bc4..81bad397bc8641292efadea7fb1235ca230bbc8e 100644 (file)
@@ -116,6 +116,19 @@ function db_get_default_charset()
        return $var[0];
 }
 
+function db_get_view_schema($view)
+{
+    global $db;
+    $schema = NULL;
+    $qry = "select view_definition from information_schema.views where table_schema=DATABASE() and table_name='$view'";
+    $res = db_query($qry,'Failed to select view schema');
+    if ($res && db_num_rows($res) == 1) {
+        $row = db_fetch_assoc($res);
+        $schema = $row['view_definition'];
+    }
+    return $schema;
+}
+
 /*
        SQL db profiling stub
 */
@@ -124,4 +137,4 @@ if (!function_exists('db_profile'))
        function db_profile($sql=false)
        {
        }
-}
\ No newline at end of file
+}