RE: [PEAR] Re: HTML_quickform setdefaults question

From: Date: Sun, 10 Dec 2006 19:30:10 +0000
Subject: RE: [PEAR] Re: HTML_quickform setdefaults question
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-26061@lists.php.net to get a copy of this message
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); var_dump($userinfo); var_dump($checked); $form->display(); This doesn't actually work. I'm trying to get the skillids into $checked as an array then passing them to my checkboxes group called $skills.... hmmm not getting it yet, any ideas why not? Thanks www.bitesoftware.com - software for a better lifestyle
From: Mark Wiesemann <wiesemann@php.net> To: pear-general@lists.php.net Subject: [PEAR] Re: HTML_quickform setdefaults question Date: Sun, 10 Dec 2006 19:55:57 +0100 MIME-Version: 1.0 Received: from lists.php.net ([216.92.131.4]) by bay0-mc8-f17.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.2444); Sun, 10 Dec 2006 10:57:19 -0800 Received: from [216.92.131.4] ([216.92.131.4:14377] helo=lists.php.net)by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTPid 94/3B-00543-F885C754 for <rav220@hotmail.com>; Sun, 10 Dec 2006 13:57:19 -0500 Received: (qmail 98666 invoked by uid 1010); 10 Dec 2006 18:56:30 -0000 Received: (qmail 98658 invoked by uid 1010); 10 Dec 2006 18:56:29 -0000 X-Message-Info: LsUYwwHHNt1IBaEHAPlRZgYC4oOoGk2BARoISlyzStU= Return-Path: <pear-general-return-26060-rav220=hotmail.com@lists.php.net> X-Host-Fingerprint: 216.92.131.4 lists.php.net Mailing-List: contact pear-general-help@lists.php.net; run by ezmlm Precedence: bulk list-help: <mailto:pear-general-help@lists.php.net> list-unsubscribe: <mailto:pear-general-unsubscribe@lists.php.net> list-post: <mailto:pear-general@lists.php.net> Delivered-To: mailing list pear-general@lists.php.net Delivered-To: ezmlm-scan-pear-general@lists.php.net Delivered-To: ezmlm-pear-general@lists.php.net X-Host-Fingerprint: 212.117.93.247 clx-ac2-247-3.westend.com User-Agent: 40tude_Dialog/2.0.15.1de (79726a3f.382.192) References: <BAY108-F20068404034AF0BD21EACD9AD10@phx.gbl> Posted-And-Mailed: yes X-Posted-By: 212.117.93.247 X-OriginalArrivalTime: 10 Dec 2006 18:57:19.0815 (UTC) FILETIME=[04B2ED70:01C71C8D] rav k wrote: Does anyone know if I can use 2 different setDefaults for my form? ie. Use setDefault1 to fill in one part of my form and setDefault2 for another part? I have to do this because I'm getting different bits of info from different tables... Can someone please advise? Please ask your questions only once. There are two simple solutions for your problem: - call setDefaults() twice; first with the data for some of the fields, then with the data for some other fields - merge the arrays with the data for all fields and pass this array to setDefaults() Regards, Mark -- PEAR General Mailing List (http://pear.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
_________________________________________________________________ Find Singles In Your Area Now With Match.com! msnuk.match.com

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