You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

Update all answer articles using script at same time,

Question
12
Views
0
Comments
edited Jul 9, 2020 9:35PM in B2B Service

Summary

I wanted to update all the articles using a custom script but it's not able to process more than 200 records.

Content

I am trying to update all the articles using custom script. I wrote the script which fetches all the answers and then remove a particular lines from the answers. 

But in doing so i am able to reterieve only 200 records or so. Is there any better way to update thousands articles.

$ar = RNCPHP\AnalyticsReport::fetch( 106134 );

$arr= $ar->run();

for ( $ii = $arr->count(); $ii--; )

{

$row = $arr->next();

$answer = RNCPHP\Answer::fetch( $row["Answer ID"] );

 $html = preg_replace('#<button id="wmcckbtopBtn"(.*?)>(.*?)</script>#is', '', $answer->Solution);

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!