30 lines
722 B
PHP
Executable File
30 lines
722 B
PHP
Executable File
<?php
|
|
// phpdotenv initialization
|
|
require_once 'vendor/autoload.php';
|
|
$dotenv = Dotenv\Dotenv::createImmutable(__DIR__ . '/..');
|
|
$dotenv->safeLoad();
|
|
|
|
// Use environment variables for the database password and IP address.
|
|
$db_user = $_ENV['DATABASE_USER'];
|
|
$db_pass = $_ENV['DATABASE_PASSWORD'];
|
|
|
|
define('HOST', 'localhost');
|
|
define('USER', $db_user);
|
|
define('PASS', $db_pass);
|
|
define('DB', 'vintagecodingdotnet');
|
|
|
|
function get_article_cards()
|
|
{
|
|
$conn = mysqli_connect(HOST, USER, PASS, DB);
|
|
|
|
$query = 'SELECT * FROM accounts;';
|
|
|
|
$results = mysqli_query($conn, $query);
|
|
echo '<pre>';
|
|
while ($row = mysqli_fetch_array($results)) {
|
|
print_r($row);
|
|
echo '<br>';
|
|
}
|
|
echo '</pre>';
|
|
}
|