summaryrefslogtreecommitdiffstats
path: root/do.php
diff options
context:
space:
mode:
authorPatrick Davison <snapwilliam@gmail.com>2011-12-28 11:19:46 -0800
committerPatrick Davison <snapwilliam@gmail.com>2011-12-28 11:19:46 -0800
commitfcdb42e572af8a274c3cd6cd904d65bdd2c0ad6b (patch)
tree512f14831b8880190825a9f92dc924aac228af61 /do.php
parenta2b8ce3fd13701c1b5756e5bc7f03fa1f22ac9a8 (diff)
downloadpathery-fcdb42e572af8a274c3cd6cd904d65bdd2c0ad6b.tar.xz
Save last-solution.
Diffstat (limited to 'do.php')
-rw-r--r--do.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/do.php b/do.php
index 8ff2162..b49fc29 100644
--- a/do.php
+++ b/do.php
@@ -177,6 +177,15 @@ if ($_GET['r'] == 'getpath') {
`mapID` = '$mapID'
";
mysql_query($sql);
+ //Update the solution, if it's the same score.
+ } elseif ($reqMoves == $moves) {
+ $sql = "UPDATE `solutions`
+ SET `moves` = '$moves' ,
+ `solution` = '$solution'
+ WHERE `userID` = '$userID' AND
+ `mapID` = '$mapID'
+ ";
+ mysql_query($sql);
}
} else {
//Store solution.