prepare("INSERT INTO competition_submissions (user_id, competition_id, file_path) VALUES (?, ?, ?)"); $stmt->execute([$user_id, $competition_id, $file_path]); } catch (PDOException $e) { // Handle DB error // You might want to log this error // If DB insert fails, you might want to delete the uploaded file unlink($file_path); header("location: user_dashboard.php?upload_error=2"); exit; } } header("location: user_dashboard.php"); exit; } header("location: user_dashboard.php"); exit;