Re: HTML_QuickForm_advmultiselect: error
| From: | Laurent Laville | Date: | Thu, 01 Sep 2005 16:58:33 +0000 |
| Subject: | Re: HTML_QuickForm_advmultiselect: error | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-20725@lists.php.net to get a copy of this message | ||
l Burnerheimerton wrote:
Laurent - I like your new example of what we discussed recently on this forum - setting selected values using a MySQL database. I copied your example code and substitued in a new DB connection (that works through the site using $db) and the following SELECT statements: $queryAll = 'SELECT people_ID, CONCAT(lName, ", ", fName) AS personName FROM people'; $querySel = 'SELECT people_ID FROM people WHERE people_ID = 17'; And changed the LOAD statement to accomodate my nomenclature: $ams->load($db, $queryAll, 'personName', 'people_id', $affected_user); It displayed but threw the following 3 errors: Notice: Undefined index: people_id in \pear\lib\HTML\QuickForm\select.php on line 369 Notice: Undefined index: people_id in \pear\lib\HTML\QuickForm\select.php on line 369 Notice: Undefined index: people_id in \pear\lib\HTML\QuickForm\select.php on line 369 It displayed the blank option in the affected list. When processed (click the SEND button), it displayed the correct number of arrays but no array values were sent: Array (Probably because there is a typo error (case sensitive)[user] => Array ( [0] => [1] => [2] => )[send] => Send) The only difference I can see is that your database key is "userid VARCHAR(5)". Mine is INT. Any ideas? Many thanks!
$ams->load($db, $queryAll, 'personName', 'people_id', $affected_user);"people_id" , while in your query its "people_ID"