Skip to content

Commit

Permalink
minor optimizations
Browse files Browse the repository at this point in the history
  • Loading branch information
zolex committed Apr 26, 2012
1 parent 5cb03fd commit a4ccf26
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion accounts.php
@@ -1,6 +1,6 @@
<?php

$source = $_GET;
$source = $_POST;
require('../dbh.php'); // $dbh
require('accounts.class.php'); // Accounts

Expand Down
11 changes: 8 additions & 3 deletions submit.php
Expand Up @@ -30,12 +30,17 @@

$writer->startElement("submission");

$stmt = $dbh->prepare("SELECT id FROM `maps` WHERE `filename` = :filename LIMIT 1;");
$stmt = $dbh->prepare("SELECT `id` FROM `maps` WHERE `filename` = :filename LIMIT 1;");
$stmt->bindValue('filename', $source['map']);

if (!$stmt->execute() || !$map = $stmt->fetchObject()) {
if (!$stmt->execute()) {

throw new Exception("could not select maps");
throw new Exception("could not select map");
}

if (!$map = $stmt->fetchObject()) {

throw new Exception("Map not found");
}

// get player by session
Expand Down

0 comments on commit a4ccf26

Please sign in to comment.