lookup()

Create array with content from imported database table to be used with select() method. The array will use the same keyfield as defined in backend's table configuration.

array lookup( string name [, string field [, string where ]])

Return

Array to be used with select() method

Parameter
Description
nameDatabase table name
fieldField to be shown in selectbox. If this parameter is omitted, the name-field defined in the backend's table configuration will be used.
whereSQL WHERE statement (see example below)

Create array from table

$FORM->lookup("data_api_object")
RETURN: ARRAY [8]

Select specific data from table

$FORM->lookup("data_api_object", "systemfile", "object != 'EXEC'")
RETURN: ARRAY [7]

Create select box with table contents

$FORM->select("selectfield", "Select", $FORM->lookup("data_api_object"))
RETURN: '<div id="frm_testform_outer_selectfield" class="frm_testform div_outer div_select selectfield"> <label for="frm_testform_selectfield" class="lbl_input selectfield">Select</label><select name="selectfield" class="sel_input selectfield" id="frm_testfo ...