From 3f612d6e36178b5a7c1a65b2319c46025e75be42 Mon Sep 17 00:00:00 2001 From: Martin Ambrus Date: Sat, 4 Nov 2017 09:26:45 +0100 Subject: [PATCH] fix: alliance cannot be created This only happens on newer MySQL versions where column type vs inserted type are being checked (so we cannot insert empty string into an int column, even if that column has a default value). Fixes #249 --- GameEngine/Database.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GameEngine/Database.php b/GameEngine/Database.php index 5cbee90d..691aa37e 100755 --- a/GameEngine/Database.php +++ b/GameEngine/Database.php @@ -1777,7 +1777,7 @@ class MYSQLi_DB implements IDbConnection { function createAlliance($tag, $name, $uid, $max) { list($tag, $name, $uid, $max) = $this->escape_input($tag, $name, (int) $uid, (int) $max); - $q = "INSERT into " . TB_PREFIX . "alidata values (0,'$name','$tag',$uid,0,0,0,'','',$max,'','','','','','','','','')"; + $q = "INSERT into " . TB_PREFIX . "alidata values (0,'$name','$tag',$uid,0,0,0,'','',$max,0,0,0,0,0,0,0,0,0)"; mysqli_query($this->dblink,$q); return mysqli_insert_id($this->dblink); }