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

Home » RADICORE development » Transaction Patterns » Dropdown list (Selecting occurences)
Dropdown list [message #4473] Mon, 18 August 2014 09:21 Go to previous message
htManager is currently offline  htManager
Messages: 415
Registered: May 2014
Senior Member
I have a dropdown list in which I want to list entries from a database table. Now I don't know how to change or create the selection criteria.

Can I change the $where criteria in the _cm_getValRep method of the class? If yes, how can I do this?

The first fields of the primary key are the same for both tables. So how can I get these values for using in the selection criteria?

Here is the code:

function _cm_getValRep ($item=null, $where=null)
// get Value/Representation list as an associative array.
{
$array = array();

if ($item == 'ma_mitglieder') {
// get data from the database
$where = $where_mannschaft;
$this->sql_select = 'kontakt_ma_user_id, kontakt_ma_user_seq_no, kontakt_ma_name, kontakt_ma_vorname';
$this->sql_orderby = 'kontakt_ma_name';
$this->sql_ordery_seq = 'asc';
$data = $this->getData($where);

// convert each row into 'id=desc' in the output array
foreach ($data as $row => $rowdata) {
$rowvalues = array_values($rowdata);
$array[$rowvalues[0]] = $rowvalues[0];
} // foreach

return $array;
} // if

return $array;

} // _cm_getValRep
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Calculated fields
Next Topic: Error running output2 pattern
Goto Forum:
  


Current Time: Fri Apr 26 22:01:04 EDT 2024

Total time taken to generate the page: 0.06813 seconds