Limit of Number of Inserts to 1000

We have created a theme that, among all else, contains an loop for insert statements in the form:

foreach ($jqueryarray as $key=>$jqvalue){
$insert_query=$wpdb->prepare(“INSERT INTO mmt_gmt(mmt_id,gmt_id) VALUES (’$get_cat_id’, ‘$jqvalue’)”,“Insert”);
$wpdb->query($insert_query);
$html .="

  • ’$jqvalue’
  • ";
    }

    The query runs fine in Local but when migrated to Ubuntu 18.04 in Amazon AWS, only the first 1000 inserts are actually committed to the DB. I am wondering why it is working fine on local and not in the server. Is there a php.ini variable that I have to change to accomodate it? Please note that I do not use custom deployment in my Local site so I have no access to php.ini as the config folder is not present.

    Thanking you in anticipation.

    Just to let you know that the solution was found in the form of a variable in the php.ini file.

    ; How many GET/POST/COOKIE input variables may be accepted

    max_input_vars = 5000

    Initially is commented and the default value (even if it is commented) is 1000. This is not the case on Local but it is the case in Ubuntu/apache.

    Best,

    D.