Spaces:
Sleeping
Sleeping
ladogton2010
commited on
Commit
·
347035e
1
Parent(s):
1393e05
test database 9
Browse files- app/config.php +12 -15
app/config.php
CHANGED
@@ -2,25 +2,22 @@
|
|
2 |
<html>
|
3 |
<body>
|
4 |
<?php
|
5 |
-
ini_set('display_errors', 1);
|
6 |
-
ini_set('display_startup_errors', 1);
|
7 |
-
error_reporting(E_ALL);
|
8 |
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
|
14 |
-
|
15 |
-
|
16 |
-
if (!$conn) {
|
17 |
-
die('Could not connect:' . mysqli_connect_error());
|
18 |
-
}
|
19 |
|
20 |
-
|
21 |
-
|
22 |
|
23 |
-
|
24 |
?>
|
25 |
</body>
|
26 |
</html>
|
|
|
2 |
<html>
|
3 |
<body>
|
4 |
<?php
|
|
|
|
|
|
|
5 |
|
6 |
+
define('DB_NAME', getenv('DB_DATABASE'));
|
7 |
+
define('DB_USER', getenv('DB_USER'));
|
8 |
+
define('DB_PASSWORD', getenv('DB_PASSWORD'));
|
9 |
+
define('DB_HOST', getenv('DB_HOST'));
|
10 |
|
11 |
+
$conn = @mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);
|
12 |
+
echo("<h1>DATA</h1>");
|
13 |
+
if (!$conn) {
|
14 |
+
die('Could not connect:' . mysqli_connect_error());
|
15 |
+
}
|
16 |
|
17 |
+
$sql = "SELECT * FROM personas;";
|
18 |
+
$response = @mysqli_query($conn, $sql);
|
19 |
|
20 |
+
var_dump(mysqli_fetch_array($response));
|
21 |
?>
|
22 |
</body>
|
23 |
</html>
|