Radicore Forum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » RADICORE » How To » drop-down (drop-down)
Re: drop-down [message #2550 is a reply to message #2549] Wed, 16 June 2010 08:52 Go to previous message
AJM is currently offline  AJM
Messages: 2371
Registered: April 2006
Location: Surrey, UK
Senior Member
Here is an example of how to build a ValRep array with composite keys:
$this->sql_select     = 'part1, part2, description';
$this->sql_orderby    = 'part1, part2';
$this->sql_ordery_seq = 'asc';
$data = $this->getData(null);

// convert each row into 'id=desc' in the output array
foreach ($data as $row => $rowdata) {
    $key = $rowdata['part1].'/'.$rowdata['part2'];
    $array[$key] = $rowdata['description'];
} // foreach

return $array;

Note here that each key string is in the format 'part1/part2' with '/' as the separator. When the selected key is sent in via the $_POST array you have to split this single string field back into its component parts.


 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Filter records based on user
Next Topic: list2
Goto Forum:
  


Current Time: Wed Nov 27 06:17:51 EST 2024

Total time taken to generate the page: 0.00952 seconds