N
N
Norbyt2015-09-30 10:23:09
PHP
Norbyt, 2015-09-30 10:23:09

Why is CSaleOrderUserPropsValue::GetList outputting too many rows?

I know the question is poorly worded. But here are these lines:

$db_propVals = CSaleOrderUserPropsValue::GetList(array("ID" => "ASC"), Array("USER_PROPS_ID"=>array(172)));
while ($arPropVals = $db_propVals->Fetch())
{
   echo $arPropVals["USER_VALUE_NAME"]."=".$arPropVals["VALUE"]."<br>";
}

displays more than 17 thousand times the email name and phone number, which takes a long time to load the page. Tell me what's wrong

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey Zelensky, 2015-09-30
@SergeyZelensky-Rostov

I don’t know Bitrix and I don’t want to know, well, judging by the code, you are pulling out all the lines with ID 172 through while i.e. until everything is pulled out and stopped, maybe you have 17,000+ rows in the database with this id ))? read the docs on this method and most likely they made a mistake somewhere in the ::getList parameters, try to display a row from the database using another field, what will be the result

A
Andrey Kornev, 2015-10-23
@webkornevand

Perhaps an error occurs due to the fact that you are passing array(172) in the USER_PROPS_ID "" field. The example says that you need to pass ID. Make sure you pass the user profile ID, not the user ID.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question