diff --git a/src/App/Search.php b/src/App/Search.php index 3a669c0..f86230f 100644 --- a/src/App/Search.php +++ b/src/App/Search.php @@ -90,7 +90,17 @@ final class Search $stmt = $this->pdo->prepare($sql); try { $stmt->execute($bind); - return $stmt->fetchAll(\PDO::FETCH_ASSOC) ?: []; + $rows = $stmt->fetchAll(\PDO::FETCH_ASSOC) ?: []; + if (defined('APP_ENV') && APP_ENV === 'staging') { + $logOk = [ + 'status' => 'ok', + 'sql' => $sql, + 'bind' => $bind, + 'count' => count($rows), + ]; + @file_put_contents(__DIR__ . '/../../debug/search_debug.log', print_r($logOk, true)); + } + return $rows; } catch (\PDOException $e) { // Log into /debug/search_debug.log and continue with empty results $logErr = [