Documentation

ExtractFields

mixed
CDBResult::ExtractFields(
 string prefix="str_",
 bool encode=true
 )

This method declares global variables with names of ${prefix."field name"} type and values that match to corresponding names of fields, converted into HTML-safe format.
Returns an array of Array("field"=>"value" [, ...]) type and moves pointer to the next record. If the last record is reached (or there are no records in the result), the method will return "false". Non-static method.

Paramters

ParameterDescription
prefix Prefix of global variables.
Optional. By default "str_".
encode Coverts global variables into HTML- safe format.
Optional. By default - "true".

See also

Examples of use

<select>
<?
$rs = CGroup::GetList($order="ID", $by="ASC");
while ($rs->ExtractFields("g_")) :
   ?><option value="<?=$g_ID?>"
   <?if (IntVal($g_ID)==IntVal($show_perms_for)) echo " selected";?>
   ><?=$g_NAME?></option><?
endwhile;
?>
</select>


© «Bitrix24», 2001-2024