[prev in list] [next in list] [prev in thread] [next in thread] 

List:       phplib-dev
Subject:    [PHPLIB-DEV] Table incompatibility
From:       Kristian =?iso-8859-1?Q?K=F6hntopp?= <kk () netuse ! de>
Date:       1999-10-27 15:56:22
[Download RAW message or body]


I created a Table incompatibility while fixing a problem with the
Table class. When using an array for Table as in

$ary["foo"]["blubb"] = 1;
$ary["foo"]["ugh"]   = 2;
$ary["bar"]["ugh"]   = 3;
$ary["bar"]["blubb"] = 4;

Table will print

1 2
4 3

when not using $t->fields and will print

1 2
3 4

which is correct when using $t->fields. My change was

@@ -839,13 +839,10 @@
       while(list($key, $val) = each($data))
       {
         if (ereg($this->filter, $key))
-          $d[] = $key;
+          $this->fields[] = $key;
       }
     }
-    else
-    {
-      $d = $this->fields;
-    }
+    $d = $this->fields;

     if ($debug)
     {

which is basically to use $this->fields every time. When
a Table is reused for a different table structure, the
$this->fields content gets into the way, which is why this
is a wrong fix. Could someone (Jeffrey?) please look into 
this and devise a better fix?

Kristian

-- 
Kristian Köhntopp, NetUSE Kommunikationstechnologie GmbH
Siemenswall, D-24107 Kiel, Germany, +49 431 386 436 00
Using PHP3? See our web development library at
http://phplib.netuse.de/ (We have moved! Update your bookmarks!)
-
PHPLIB Developers Mailing List. Send messages to <phplib-dev@lists.netuse.de>.
To unsubscribe, send "unsubscribe" to <phplib-dev-request@lists.netuse.de> in
the body, not the subject, of your message.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic