X-Git-Url: https://delta.frontaccounting.com/gitweb/?p=fa-stable.git;a=blobdiff_plain;f=includes%2Fdb%2Fconnect_db.inc;h=81bad397bc8641292efadea7fb1235ca230bbc8e;hp=b671945ab6e83daf6b9fe7ab8102a6d643c07bc4;hb=c34e563fae8003a637a485b4eaf634678b90c60f;hpb=fd6a34b4c0d7e0af05ab5940eac6454fc499722d diff --git a/includes/db/connect_db.inc b/includes/db/connect_db.inc index b671945a..81bad397 100644 --- a/includes/db/connect_db.inc +++ b/includes/db/connect_db.inc @@ -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 +}