commit 664035a4bf8dd6df09039b990e58aa08a4ae013a
parent 4df3c3c9637bd462087266f5520f147714872d4e
Author: Bertrand BRUN <bertrand0brun@gmail.com>
Date: Wed, 16 Mar 2011 11:09:48 +0100
Correction d'un autre probleme de syntaxe
Diffstat:
3 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/code/serveur/php/db.php b/code/serveur/php/db.php
@@ -16,6 +16,8 @@ function getDB() {
}
function closeDB() {
+ global $getDBSingleton;
+
if ($getDBSingleton) $getDBSingleton->close();
}
diff --git a/code/serveur/php/pticlic.php b/code/serveur/php/pticlic.php
@@ -574,7 +574,7 @@ function setGame($user, $pgid, $gid, $answers)
$db->exec("commit;");
$scores['total'] = $gameScore;
- $scores['nb] = $nbScores;
+ $scores['nb'] = $nbScores;
return $scores;
}
diff --git a/code/serveur/php/server.php b/code/serveur/php/server.php
@@ -74,9 +74,9 @@ function main()
// On renvoie une nouvelle partie pour garder le client toujours bien alimenté.
echo "{\"scoreTotal\":".$scores['total'];
echo ',"scores":[';
- for (i = 0; i < $scores['nb']; i++) {
- if (i != 0) echo ',';
- echo $scores[i];
+ for ($i = 0; $i < $scores['nb']; $i++) {
+ if ($i != 0) echo ',';
+ echo $scores[$i];
}
echo "],\"newGame\":";
echo json_encode("".game2json($user, randomGame()));