From fd890cefd71b0987d7ab4df1df43e690924accbf Mon Sep 17 00:00:00 2001 From: Zankaria Date: Sun, 7 Apr 2024 19:51:37 +0200 Subject: [PATCH] install.php: better SQL error reporting --- install.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/install.php b/install.php index 72994bfa..dfd0df73 100644 --- a/install.php +++ b/install.php @@ -945,12 +945,16 @@ if ($step == 0) { $queries[] = Element('posts.sql', array('board' => 'b')); $sql_errors = ''; + $sql_err_count = 0; foreach ($queries as $query) { if ($mysql_version < 50503) $query = preg_replace('/(CHARSET=|CHARACTER SET )utf8mb4/', '$1utf8', $query); $query = preg_replace('/^([\w\s]*)`([0-9a-zA-Z$_\x{0080}-\x{FFFF}]+)`/u', '$1``$2``', $query); - if (!query($query)) - $sql_errors .= '
  • ' . db_error() . '
  • '; + if (!query($query)) { + $sql_err_count++; + $error = db_error(); + $sql_errors .= "
  • $sql_err_count
  • "; + } } $page['title'] = 'Installation complete';