![]() 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/.cursor-server/data/User/History/632e7bad/ |
<?php
// Simple database connection test
require_once 'config/database.php';
echo "<h1>Database Connection Test</h1>";
try {
$pdo = getDBConnection();
echo "<p>✅ Database connection successful</p>";
// Check if music_tracks table exists
$stmt = $pdo->prepare("SHOW TABLES LIKE 'music_tracks'");
$stmt->execute();
$tableExists = $stmt->fetch();
if ($tableExists) {
echo "<p>✅ music_tracks table exists</p>";
// Check for completed tracks
$stmt = $pdo->prepare("
SELECT COUNT(*) as count
FROM music_tracks
WHERE status = 'complete'
AND audio_url IS NOT NULL
AND audio_url != ''
");
$stmt->execute();
$result = $stmt->fetch();
echo "<p>Found " . $result['count'] . " completed tracks with audio URLs</p>";
if ($result['count'] > 0) {
// Show first few tracks
$stmt = $pdo->prepare("
SELECT mt.title, mt.audio_url, u.name as artist_name
FROM music_tracks mt
LEFT JOIN users u ON mt.user_id = u.id
WHERE mt.status = 'complete'
AND mt.audio_url IS NOT NULL
AND mt.audio_url != ''
ORDER BY mt.created_at DESC
LIMIT 3
");
$stmt->execute();
$tracks = $stmt->fetchAll();
echo "<h3>Sample tracks:</h3>";
foreach ($tracks as $track) {
echo "<div style='border: 1px solid #ccc; padding: 10px; margin: 10px 0;'>";
echo "<strong>Title:</strong> " . htmlspecialchars($track['title']) . "<br>";
echo "<strong>Artist:</strong> " . htmlspecialchars($track['artist_name'] ?? 'Unknown') . "<br>";
echo "<strong>Audio URL:</strong> " . htmlspecialchars($track['audio_url']) . "<br>";
echo "</div>";
}
}
} else {
echo "<p>❌ music_tracks table does not exist</p>";
// Show what tables exist
$stmt = $pdo->prepare("SHOW TABLES");
$stmt->execute();
$tables = $stmt->fetchAll(PDO::FETCH_COLUMN);
echo "<h3>Available tables:</h3>";
foreach ($tables as $table) {
echo "<p>" . htmlspecialchars($table) . "</p>";
}
}
} catch (Exception $e) {
echo "<p>❌ Error: " . htmlspecialchars($e->getMessage()) . "</p>";
}
?>