![]() Server : Apache/2 System : Linux server-15-235-50-60 5.15.0-164-generic #174-Ubuntu SMP Fri Nov 14 20:25:16 UTC 2025 x86_64 User : gositeme ( 1004) PHP Version : 8.2.29 Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname Directory : /home/gositeme/domains/soundstudiopro.com/private_html/utils/ |
<?php
// Test database connection and initialization
require_once 'config/database.php';
echo "<h1>Database Test Results</h1>";
try {
// Test database connection
$pdo = getDBConnection();
if ($pdo) {
echo "<p style='color: green;'>✅ Database connection successful!</p>";
// Test table creation
if (initializeDatabase()) {
echo "<p style='color: green;'>✅ Database tables initialized successfully!</p>";
// Test user creation
$testEmail = 'test@example.com';
$testName = 'Test User';
$testPassword = 'test123';
if (createUser($testName, $testEmail, $testPassword)) {
echo "<p style='color: green;'>✅ Test user created successfully!</p>";
// Test user authentication
$user = authenticateUser($testEmail, $testPassword);
if ($user) {
echo "<p style='color: green;'>✅ User authentication successful!</p>";
echo "<p>User ID: " . $user['id'] . "</p>";
echo "<p>User Name: " . $user['name'] . "</p>";
echo "<p>Credits: " . $user['credits'] . "</p>";
echo "<p>Plan: " . $user['plan'] . "</p>";
} else {
echo "<p style='color: red;'>❌ User authentication failed!</p>";
}
} else {
echo "<p style='color: red;'>❌ Test user creation failed!</p>";
}
} else {
echo "<p style='color: red;'>❌ Database table initialization failed!</p>";
}
} else {
echo "<p style='color: red;'>❌ Database connection failed!</p>";
}
} catch (Exception $e) {
echo "<p style='color: red;'>❌ Error: " . $e->getMessage() . "</p>";
}
echo "<h2>Database Tables</h2>";
try {
$pdo = getDBConnection();
$tables = $pdo->query("SHOW TABLES")->fetchAll(PDO::FETCH_COLUMN);
echo "<ul>";
foreach ($tables as $table) {
echo "<li>$table</li>";
}
echo "</ul>";
} catch (Exception $e) {
echo "<p style='color: red;'>❌ Error listing tables: " . $e->getMessage() . "</p>";
}
?>