Working web chat with PostgreSQL

Webchat basically working when using PostgreSQL. No chatlengthlimit.
This commit is contained in:
jzdm 2021-06-18 09:16:06 +02:00 committed by GitHub
parent 5518f9a831
commit cc9071e85b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);
}