- Replaced all client-facing $e->getMessage() with generic error messages - Added error_log() with filename prefix to all catch blocks - Covered jsonError(), echo, and json_encode() response patterns - Also fixed 2 remaining display_errors=1 and add_invoice.php leak - Script-assisted fix for 75 files, manual fix for 12 remaining edge cases
11 lines
290 B
PHP
11 lines
290 B
PHP
<?php
|
|
require_once __DIR__ . '/../connect.php';
|
|
try {
|
|
$stmt = $con->prepare("DESCRIBE users");
|
|
$stmt->execute();
|
|
$columns = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
|
echo json_encode($columns);
|
|
} catch (Exception $e) {
|
|
echo json_encode(['error' => 'Database check failed']);
|
|
}
|