Re: Re: HTML_quickform setdefaults question

From: Date: Sun, 10 Dec 2006 19:55:50 +0000
Subject: Re: Re: HTML_quickform setdefaults question
References: 1 2  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-26062@lists.php.net to get a copy of this message
rav k wrote: > Thanks for the advice Mark, > > I'm doing this but I'm still not getting the right outcome: > > // GETS THE INFO FROM THE USERS TABLE > $statement=$mdb2->prepare('SELECT Userid, Profile, Email, Sendmail FROM > Users WHERE Userid = ?', array('integer'), > array('integer','text','text','integer')); > $result=$statement->execute($id['userid']); > $statement->free(); > $userinfo=$result->fetchRow(MDB2_FETCHMODE_ASSOC); > > // GETS THE SKILLS FROM USERSKILLS WHICH MATCH THE USERSID > $statement=$mdb2->prepare('SELECT Skillid FROM Userskills WHERE Userid = > ?', array('integer'), array('integer')); > $result=$statement->execute($id['userid']); > $statement->free(); > $checked = $mdb2->fetchRow($result, MDB_FETCHMODE_ASSOC); > > // SUPPOSED TO USE USERINFO TO FILL FIELDS > // $CHECKED GOES INTO SKILLS GROUP TO FILL CHECKBOXES > $form->setDefaults($userinfo); > $form->setDefaults($skills->$checked); ^^^^^^^^^ Is this a typo in your mail or do you have this really in your code? > var_dump($userinfo); > var_dump($checked); $checked sounds much better than $skills->$checked. Do you get a reasonable output here? If not, please show us how the two arrays look like. Regards, Mark

« previous php.pear.general (#26062) next »