From ea3050d1734c3d64f5ff7dd1659f48463dab9793 Mon Sep 17 00:00:00 2001 From: Benjamin Franzke Date: Sat, 26 Jan 2013 10:50:10 +0100 Subject: db_table_from_query: Fix array_fill if no columns were returned --- sqlbox/locallib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sqlbox') diff --git a/sqlbox/locallib.php b/sqlbox/locallib.php index 2968e3f..e913291 100644 --- a/sqlbox/locallib.php +++ b/sqlbox/locallib.php @@ -51,7 +51,7 @@ function db_table_from_query($db, $query) { $n = pg_num_fields($result); for ($i = 0; $i < $n; $i++) $table->head[] = pg_field_name($result, $i); - $table->align = array_fill(0, $n, 'left'); + $table->align = $n > 0 ? array_fill(0, $n, 'left') : array(); while ($row = pg_fetch_row($result)) $table->data[] = $row; -- cgit