Slim API deployment - composer install + full CRUD endpoints
This commit is contained in:
9
api/test_db.php
Normal file
9
api/test_db.php
Normal file
@@ -0,0 +1,9 @@
|
||||
<?php
|
||||
require __DIR__."/vendor/autoload.php";
|
||||
try {
|
||||
$pdo = new PDO("pgsql:host=127.0.0.1;port=5433;dbname=fahrschultermin", "fahrschultermin_api", "X9wL3pN7kRtHvMbZs4cGfYu2Dj6qAe8t");
|
||||
$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
||||
$stmt = $pdo->prepare("SELECT id, email, password_hash FROM users LIMIT 1");
|
||||
$stmt->execute();
|
||||
print_r($stmt->fetch(PDO::FETCH_ASSOC));
|
||||
} catch (Exception $e) { echo $e->getMessage(); }
|
||||
Reference in New Issue
Block a user