Centralize SQL connections

Co-authored-by: LeOSW42 <673670+LeOSW42@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-01-24 12:48:16 +00:00
parent 041e77246f
commit 92555ea2bf
7 changed files with 65 additions and 83 deletions

13
includes/database.php Normal file
View File

@@ -0,0 +1,13 @@
<?php
namespace Kabano;
function sql_connect() {
global $config;
return pg_connect(
"host=".$config['SQL_host']." dbname=".$config['SQL_db']." user=".$config['SQL_user']." password=".$config['SQL_pass']
) or die ("Could not connect to server\n");
}
?>