From 77b95607107277b98251b5bb8984f0ddd7cb2a49 Mon Sep 17 00:00:00 2001 From: Klas Lindfors Date: Fri, 15 Jun 2012 21:52:21 +0200 Subject: [PATCH] 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. --- ykval-export-clients.php | 2 +- ykval-export.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ykval-export-clients.php b/ykval-export-clients.php index cf3b5fb..b985f71 100755 --- a/ykval-export-clients.php +++ b/ykval-export-clients.php @@ -24,7 +24,7 @@ if (!$db->connect()) { $result = $db->customQuery("select id, active, created, secret, email, notes, otp from clients order by id"); while($row = $result->fetch(PDO::FETCH_ASSOC)){ echo $row['id'] . - "\t" . $row['active'] . + "\t" . (int)$row['active'] . "\t" . $row['created'] . "\t" . $row['secret'] . "\t" . $row['email'] . diff --git a/ykval-export.php b/ykval-export.php index 8d25a1d..e22a1a1 100755 --- a/ykval-export.php +++ b/ykval-export.php @@ -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"); while($row = $result->fetch(PDO::FETCH_ASSOC)){ - echo $row['active'] . + echo (int)$row['active'] . "\t" . $row['created'] . "\t" . $row['modified'] . "\t" . $row['yk_publicname'] .