Correction d'un autre probleme de syntaxe

This commit is contained in:
Bertrand BRUN 2011-03-16 11:09:48 +01:00 committed by root
parent 4df3c3c963
commit 664035a4bf
3 changed files with 6 additions and 4 deletions

View File

@ -16,6 +16,8 @@ function getDB() {
}
function closeDB() {
global $getDBSingleton;
if ($getDBSingleton) $getDBSingleton->close();
}

View File

@ -574,7 +574,7 @@ function setGame($user, $pgid, $gid, $answers)
$db->exec("commit;");
$scores['total'] = $gameScore;
$scores['nb] = $nbScores;
$scores['nb'] = $nbScores;
return $scores;
}

View File

@ -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()));