summaryrefslogtreecommitdiffstats
path: root/include/newgame.php
diff options
context:
space:
mode:
authorArun Persaud <arun@nubati.net>2015-10-04 17:03:34 -0700
committerArun Persaud <arun@nubati.net>2015-10-04 17:05:32 -0700
commit65de9655c6002bbfee76f1c3c45b312615fb375a (patch)
treecbaf2ae3fd9d5bf7db8425a8c2b6e809c77b56e2 /include/newgame.php
parenta4cdb155b19c40d9b85a06d8aae0c6b291f439fc (diff)
downloade-DoKo-65de9655c6002bbfee76f1c3c45b312615fb375a.tar.gz
e-DoKo-65de9655c6002bbfee76f1c3c45b312615fb375a.tar.bz2
e-DoKo-65de9655c6002bbfee76f1c3c45b312615fb375a.zip
BUGFIX: fix mysql insert statements (null values for timestamps didn't work anymore)
a dreamhost update to a newer sql version changed the default behavior for null inserts for timestamps. They don't insert the current timestamp anymore when a config option for mysql is set (which seems to be the case). solution: instead of inserting null always insert current_timestamp
Diffstat (limited to 'include/newgame.php')
-rw-r--r--include/newgame.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/include/newgame.php b/include/newgame.php
index 1dd056d..eb0dbdb 100644
--- a/include/newgame.php
+++ b/include/newgame.php
@@ -128,7 +128,7 @@ else
}
if($session)
- DB_query("INSERT INTO Game VALUES (NULL, NULL, '$randomNRstring', 'normal', NULL,NULL,'1',NULL,'pre',".
+ DB_query("INSERT INTO Game VALUES (CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, '$randomNRstring', 'normal', NULL,NULL,'1',NULL,'pre',".
"'$ruleset','$session' ,NULL)");
else
{
@@ -136,7 +136,7 @@ else
$max = DB_get_max_session();
$max++;
DB_query("UPDATE Game SET session='".$max."' WHERE id=".DB_quote_smart($followup));
- DB_query("INSERT INTO Game VALUES (NULL, NULL, '$randomNRstring', 'normal', NULL,NULL,'1',NULL,'pre',".
+ DB_query("INSERT INTO Game VALUES (CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, '$randomNRstring', 'normal', NULL,NULL,'1',NULL,'pre',".
"'$ruleset','$max' ,NULL)");
}
}
@@ -153,7 +153,7 @@ else
$max = DB_get_max_session();
$max++;
- DB_query("INSERT INTO Game VALUES (NULL, NULL, '$randomNRstring', 'normal', NULL,NULL,'1',NULL,'pre', ".
+ DB_query("INSERT INTO Game VALUES (CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, '$randomNRstring', 'normal', NULL,NULL,'1',NULL,'pre', ".
"'$ruleset','$max' ,NULL)");
}
$gameid = DB_insert_id();