A
A
ArrayPop2020-07-16 20:53:58
1C-Bitrix
ArrayPop, 2020-07-16 20:53:58

Why does the fetch method return only one element in bitrix?

$s = $DB->Query("
      SELECT
        QUANTITY
      FROM
        b_catalog_product 
      ");
dd($s->fetch());

How to remove all elements from the database? fetchAll doesn't work.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2020-07-16
@gangstarcj

Cycle through and collect.

while ($row = $results->Fetch())
{
echo $row['NAME'];//выводим все значения, которые вернул запрос
}

Well, read the doc https://dev.1c-bitrix.ru/api_help/main/reference/c...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question