mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-11-30 14:13:38 +01:00
Merge pull request #1 from jzdm/jzdm-postgres-webchat
Working web chat with PostgreSQL
This commit is contained in:
commit
53bc46fec5
@ -69,10 +69,12 @@ function updateStandaloneFileByServerId($fname, $sid, $content) {
|
|||||||
global $db, $dbprefix;
|
global $db, $dbprefix;
|
||||||
|
|
||||||
initDbIfNeeded();
|
initDbIfNeeded();
|
||||||
$stmt = $db->prepare('UPDATE ' . $dbprefix . 'StandaloneFiles SET Content=? WHERE FileName=? AND ServerID=?');
|
$stmt = $db->prepare('UPDATE ' . $dbprefix . 'StandaloneFiles SET Content=:content WHERE FileName=:fname AND ServerID=:sid');
|
||||||
$stmt->bind_param('ssi', $content, $fname, $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();
|
$res = $stmt->execute();
|
||||||
$stmt->close();
|
$stmt->closeCursor();
|
||||||
if (!$res) {
|
if (!$res) {
|
||||||
$res = insertStandaloneFileByServerId($fname, $sid, $content);
|
$res = insertStandaloneFileByServerId($fname, $sid, $content);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user