Bitrix Site Manager

CDBResult::ExtractFields

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

The method ExtractFields defines global variables with names in the format ${prefix."field name"}. Values of the variables are set to those of the corresponding fields,. Variables can be optionally converted to the HTML safe format.

Parameters

ParameterDescription
prefix Prefix for the global variables. Optional; str_ by default.
encode Specifies to convert the global variables to the HTML safe format. Optional; the default value is true.

Return Values

Returns an array like Array("field"=>"value" [, ...]) and moves the pointer to the next record. If no more records are available, the method returns false.

See Also

Example



<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>