From aecebff2988df12ab3cd6417d8c09b6755c8a782 Mon Sep 17 00:00:00 2001 From: qixinzhi Date: Thu, 13 Jun 2024 09:11:10 +0000 Subject: [PATCH] + [bug#51074,start,0.5h,1h] add createView function. --- misc/prepareBIData.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/misc/prepareBIData.php b/misc/prepareBIData.php index 2f58514ec2..c1e4345707 100644 --- a/misc/prepareBIData.php +++ b/misc/prepareBIData.php @@ -6,7 +6,6 @@ if(count($argv) < 7) exit; } - function getPDO($argv) { global $pdo; @@ -75,6 +74,15 @@ function insert($table, $data) $statement->execute(); } +function createView($viewName, $sql) +{ + global $pdo; + + $prepareSql = "CREATE OR REPLACE VIEW $viewName AS $sql"; + $statement = $pdo->prepare($prepareSql); + $statement->execute(); +} + global $pdo; $path = $argv[6]; getPDO($argv);