[phplib] Stuffing $db->("bla") into add_element() From: Jens Benecke (phplib <email protected>)
Date: 08/27/00

Hi,

The following returns an empty form element:

        $f = new form;
        $f->add_element(array( ....., "value"=>$db->f("col1"), ....));

whereas this works perfectly but is cumbersome if you have >30 elements:

        $tmp = $db->f("col1");
        $f->add_element(array( ....., "value"=>$tmp, ....));

This also works, but is also suboptimal (too much code):

        $Title = $db->f("col1");
        $f->add_element(array("name"=>"Title", ....));

What am I doing wrong? Why can't I put the value directly into the form
element?

Or is there some other clever way of pre-filling a form with a fixed layout
(so no table or something is possible) with a database query result?

-- 
ciao, Jens (mailaddr im Header)                 http://www.pinguin.conetix.de
"Schiebe nie etwas auf Boshaftigkeit, was           http://www.hitch-hiker.de
ausreichend durch Dummheit erklärt werden kann."       http://www.linuxfaq.de

  • application/pgp-signature attachment: stored