Re: Re: HTML_quickform setdefaults question

From: Date: Sun, 10 Dec 2006 20:06:15 +0000
Subject: Re: Re: HTML_quickform setdefaults question
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-26063@lists.php.net to get a copy of this message
Ok [SORRY MARK I REPLIED TO YOU DIRECTLY BY ACCIDENT!] Yes I did have var_dump lines as I was trying to figure out if my output was at least correct - I don't think it is... This is the array I get: array(4) { ["userid"]=> int(3) ["profile"]=> string(105) "This is a test profile. The test profile shows information about the user and their business information." ["email"]=> string(18) "rav220@hotmail.com" ["sendmail"]=> int(1) } array(1) { ["skillid"]=> int(2) } Now array(4) is correct but array(1) which is for the skills is not correct. 2 is the first field of what should be 3 objets - ie. it should return 2, 3 and 6. I tried fetchCol but just got some error [column is not defined in the result set: 2]... What I want is to put 2, 3 and 6 into the array and then the corresponding skill[n] would appear checked; in this case skills[2], [3] and [6].. Another point is that my form is made up like this : Userid, Profile, Email, SKILLS, then Sendmail. So I'm just wondering if I do setDefaults($checked) whether it would now what to use it against. www.bitesoftware.com - software for a better lifestyle
From: Mark Wiesemann <wiesemann@php.net> To: pear-general@lists.php.net Subject: Re: [PEAR] Re: HTML_quickform setdefaults question Date: Sun, 10 Dec 2006 20:55:50 +0100 MIME-Version: 1.0 Received: from lists.php.net ([216.92.131.4]) by bay0-mc1-f11.bay0.hotmail.com with Microsoft SMTPSVC(6.0.3790.2444); Sun, 10 Dec 2006 11:56:36 -0800 Received: from [216.92.131.4] ([216.92.131.4:19014] helo=lists.php.net)by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTPid 34/4D-00543-4766C754 for <rav220@hotmail.com>; Sun, 10 Dec 2006 14:56:36 -0500 Received: (qmail 12553 invoked by uid 1010); 10 Dec 2006 19:56:22 -0000 Received: (qmail 12545 invoked by uid 1010); 10 Dec 2006 19:56:22 -0000 X-Message-Info: LsUYwwHHNt3660MmjhEvYg2f34OAemlK3oXsmRrh6gU= Return-Path: <pear-general-return-26062-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 (569ede7b.497.87) References: <vngpw3r13h7n.1iwuqh2i94w03.dlg@40tude.net> <BAY108-F35AB25E3A2F80E1923C77A9AD10@phx.gbl> X-Posted-By: 212.117.93.247 X-OriginalArrivalTime: 10 Dec 2006 19:56:37.0017 (UTC) FILETIME=[4CF4E090:01C71C95] 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 -- 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 (#26063) next »