From cc9071e85b8a17bfcecd9935884a89bf51d19fb3 Mon Sep 17 00:00:00 2001 From: jzdm <2634254+jzdm@users.noreply.github.com> Date: Fri, 18 Jun 2021 09:16:06 +0200 Subject: [PATCH] Working web chat with PostgreSQL Webchat basically working when using PostgreSQL. No chatlengthlimit. --- .../extracted/web/standalone/PostgreSQL_funcs.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/DynmapCore/src/main/resources/extracted/web/standalone/PostgreSQL_funcs.php b/DynmapCore/src/main/resources/extracted/web/standalone/PostgreSQL_funcs.php index 08019635..51b4315c 100644 --- a/DynmapCore/src/main/resources/extracted/web/standalone/PostgreSQL_funcs.php +++ b/DynmapCore/src/main/resources/extracted/web/standalone/PostgreSQL_funcs.php @@ -69,10 +69,12 @@ function updateStandaloneFileByServerId($fname, $sid, $content) { global $db, $dbprefix; initDbIfNeeded(); - $stmt = $db->prepare('UPDATE ' . $dbprefix . 'StandaloneFiles SET Content=? WHERE FileName=? AND ServerID=?'); - $stmt->bind_param('ssi', $content, $fname, $sid); + $stmt = $db->prepare('UPDATE ' . $dbprefix . 'StandaloneFiles SET Content=:content WHERE FileName=:fname AND ServerID=:sid'); + $stmt->bindParam(':content', $content, PDO::PARAM_STR); + $stmt->bindParam(':fname', $fname, PDO::PARAM_STR); + $stmt->bindParam(':sid', $sid, PDO::PARAM_INT); $res = $stmt->execute(); - $stmt->close(); + $stmt->closeCursor(); if (!$res) { $res = insertStandaloneFileByServerId($fname, $sid, $content); }