G
G
Good Samaritan2018-04-27 13:36:44
1C-Bitrix
Good Samaritan, 2018-04-27 13:36:44

How, knowing the symbolic code of the partition, get its ID?

My page receives $_REQUEST['CODE'] of a section, how can I get the section ID knowing its character code ?
Tried like this

$rsSections = CIBlockSection::GetList(array(),array('IBLOCK_ID' => 25, '=CODE' => $_REQUEST['CODE']),false,array("IBLOCK_SECTION_ID "));
  if ($arSection = $rsSections->Fetch())
  {
    echo 'ID секции: '.$arSection['IBLOCK_SECTION_ID'];
  }

does not display

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
I'm Yoda, 2018-04-27
@Anadi

Add an ID to the selection, array("IBLOCK_SECTION_ID", "ID")

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question