1
0
mirror of https://github.com/Yubico/yubikey-val.git synced 2025-03-04 12:29:19 +01:00

with postgres the bool active is returned as a php bool

that's casted to a string gives 1 when true and empty string when false.. cast to an int to get 1 and 0.
This commit is contained in:
Klas Lindfors 2012-06-15 21:52:21 +02:00
parent dfbe5a0ddf
commit 77b9560710
2 changed files with 2 additions and 2 deletions

View File

@ -24,7 +24,7 @@ if (!$db->connect()) {
$result = $db->customQuery("select id, active, created, secret, email, notes, otp from clients order by id"); $result = $db->customQuery("select id, active, created, secret, email, notes, otp from clients order by id");
while($row = $result->fetch(PDO::FETCH_ASSOC)){ while($row = $result->fetch(PDO::FETCH_ASSOC)){
echo $row['id'] . echo $row['id'] .
"\t" . $row['active'] . "\t" . (int)$row['active'] .
"\t" . $row['created'] . "\t" . $row['created'] .
"\t" . $row['secret'] . "\t" . $row['secret'] .
"\t" . $row['email'] . "\t" . $row['email'] .

View File

@ -23,7 +23,7 @@ if (!$db->connect()) {
$result=$db->customQuery("SELECT active, created, modified, yk_publicname, yk_counter, yk_use, yk_low, yk_high, nonce, notes FROM yubikeys ORDER BY yk_publicname"); $result=$db->customQuery("SELECT active, created, modified, yk_publicname, yk_counter, yk_use, yk_low, yk_high, nonce, notes FROM yubikeys ORDER BY yk_publicname");
while($row = $result->fetch(PDO::FETCH_ASSOC)){ while($row = $result->fetch(PDO::FETCH_ASSOC)){
echo $row['active'] . echo (int)$row['active'] .
"\t" . $row['created'] . "\t" . $row['created'] .
"\t" . $row['modified'] . "\t" . $row['modified'] .
"\t" . $row['yk_publicname'] . "\t" . $row['yk_publicname'] .