Example #1
0
function getBans($id)
{
    $sql = "select * FROM bans WHERE id=:id";
    try {
        $db = getConnection();
        $stmt = $db->prepare($sql);
        $stmt->bindParam("id", $id);
        $stmt->execute();
        $ban = $stmt->fetchObject();
        unset($ban->id);
        $ban->first = getChampionSlim($ban->first);
        $ban->second = getChampionSlim($ban->second);
        $ban->third = getChampionSlim($ban->third);
        return $ban;
    } catch (PDOException $e) {
        return null;
    }
}
Example #2
0
function getCompo($id)
{
    $sql = "select * FROM compos WHERE id=:id";
    try {
        $db = getConnection();
        $stmt = $db->prepare($sql);
        $stmt->bindParam("id", $id);
        $stmt->execute();
        $compo = $stmt->fetchObject();
        unset($compo->id);
        $compo->top = getChampionSlim($compo->top);
        $compo->jungle = getChampionSlim($compo->jungle);
        $compo->mid = getChampionSlim($compo->mid);
        $compo->adc = getChampionSlim($compo->adc);
        $compo->support = getChampionSlim($compo->support);
        return $compo;
    } catch (PDOException $e) {
        return null;
    }
}