How in the type of information_block site_content to select all the partition id?

$arSelect = Array("ID"); $arOrder = Array("SORT"=>"ASC"); $arFilter = Array("IBLOCK_TYPE"=>"site_content"); $res = CIBlockSection::GetList($arOrder, $arFilter, false, false, $arSelect); while($ob = $res->Fetch()) { echo $ob["ID"])."<br>"; } 

    1 answer 1

    The error was: echo $ob["ID"])."<br>"; unnecessary closing parentheses.

    Work code:

     if(CModule::IncludeModule("iblock")){ $arSelect = Array("ID"); $arOrder = Array("SORT"=>"ASC"); $arFilter = Array("IBLOCK_TYPE"=>"site_content"); $res = CIBlockSection::GetList($arOrder, $arFilter, false, $arSelect); while($ob = $res->Fetch()) echo $ob["ID"]."<br>"; } 
    • I don’t quite agree with you, because I need to select all the section id sections from the info_block type site_content, so this option is not suitable. Tell me how to fix it? - ChromeChrome
    • @ChromeChrome Made the changes - Mihanik71
    • @ChromeChrome corrected. In CIBlockSection::GetList $arSelect 4 parameter - Mihanik71
    • @ChromeChrome Helped? - Mihanik71
    • strange koneshcho, but for some reason, not all are displayed (( - ChromeChrome