From 233c3f6b4e76ab87fa631745b96440949ebb4251 Mon Sep 17 00:00:00 2001 From: Slim Amamou Date: Thu, 7 Feb 2008 09:20:25 +0100 Subject: [PATCH] BugFix : quand le resultat etait vide, il affichait un message d'erreur --- bazdig/sql/exec/index.php | 20 ++++++++++++-------- ini.php | 23 +++++++++++++++++++++++ 2 files changed, 35 insertions(+), 8 deletions(-) create mode 100644 ini.php diff --git a/bazdig/sql/exec/index.php b/bazdig/sql/exec/index.php index 94d97fe..db5d28b 100644 --- a/bazdig/sql/exec/index.php +++ b/bazdig/sql/exec/index.php @@ -44,17 +44,21 @@ "; - foreach ($columns as $c) { - echo ""; - } - echo ""; - foreach ($rows as $r) { + if (count($rows) < 1) { + echo ""; + } else { echo ""; - foreach ($r as $value) { - echo ""; + foreach ($columns as $c) { + echo ""; } echo ""; + foreach ($rows as $r) { + echo ""; + foreach ($r as $value) { + echo ""; + } + echo ""; + } } ?>
$c
Empty
$value$c
$value
diff --git a/ini.php b/ini.php new file mode 100644 index 0000000..844297a --- /dev/null +++ b/ini.php @@ -0,0 +1,23 @@ +setparam("db", $bazdig->get('/bazdig.db')); + +function columnNames($row) +{ + $names = array(); + if (is_array($row)) $names = array_keys($row); + return $names; +} + +function firstWord($string) +{ + $string = trim($string); + if (!$pos = strpos($string, ' ')) return $string; + return substr($string, 0, $pos); +} -- 2.11.4.GIT