This repository has been archived on 2024-07-18. You can view files and clone it, but cannot push or open issues or pull requests.
lwb5/scripts/game/beta5/alliance/library/getId.inc

22 lines
412 B
PHP
Raw Normal View History

2016-01-10 11:01:49 +01:00
<?php
class beta5_alliance_getId {
function beta5_alliance_getId($lib) {
$this->lib = $lib;
$this->db = $this->lib->game->db;
}
// Get alliance identifier by tag
function run($tag) {
$q = $this->db->query("SELECT id FROM alliance WHERE LOWER(tag)='" . addslashes(strtolower($tag)) . "'");
if (!($q && dbCount($q) == 1)) {
return null;
}
list($id) = dbFetchArray($q);
return $id;
}
}
?>