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
This commit is contained in:
Martin Ambrus
2017-11-04 09:26:45 +01:00
parent c0a9e9411e
commit 3f612d6e36
+1 -1
View File
@@ -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);
}