1
0
mirror of https://github.com/Yubico/yubikey-val.git synced 2025-02-01 01:52:18 +01:00

add 'as count' to sql to get it working on mysql

This commit is contained in:
Klas Lindfors 2012-06-29 12:46:01 +02:00
parent c4a6fdfc9d
commit 1b848cb77e

View File

@ -47,7 +47,7 @@ if (!$db->connect()) {
}
function get_count($db, $table, $conditions) {
$res = $db->customQuery('SELECT count(1) FROM ' . $table . ' WHERE ' . $conditions);
$res = $db->customQuery('SELECT count(1) as count FROM ' . $table . ' WHERE ' . $conditions);
if ($res) {
$r = $res->fetch(PDO::FETCH_ASSOC);
return $r['count'];