Initial upload, docker environment
This commit is contained in:
1795
src/adminer-4.8.1.php
Normal file
1795
src/adminer-4.8.1.php
Normal file
File diff suppressed because one or more lines are too long
8
src/db_config.php
Normal file
8
src/db_config.php
Normal file
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
$db_host = "postgres";
|
||||
$db_name = "pvvmdb";
|
||||
$db_user = "pvvmdb";
|
||||
$db_pass= "pvvmdb";
|
||||
|
||||
?>
|
||||
7
src/db_connect.php
Normal file
7
src/db_connect.php
Normal file
@@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
include_once 'db_config.php';
|
||||
$dbconn = pg_connect("host=$db_host dbname=$db_name user=$db_user password=$db_pass")
|
||||
or die('Could not connect: ' . pg_last_error());
|
||||
|
||||
?>
|
||||
16
src/index.php
Normal file
16
src/index.php
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
include('./db_connect.php');
|
||||
|
||||
|
||||
$res = pg_query($dbconn, "SELECT * FROM users");
|
||||
if (!$res) {
|
||||
echo "An error occurred.\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
while ($row = pg_fetch_row($res)) {
|
||||
echo "id: $row[0] username: $row[1]";
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user