Limiting Array via POST

Asked

Viewed 62 times

0

Guys, I was picking up on my code always giving offset error and things like that, when I discovered that somehow my array is not coming complete.

I have a form, where it is fed according to the results of the database.

<?php
$Despesas = new Read();
$Despesas->ExeRead("tb_contas", "WHERE id_condominio = :idC AND fg_ativo = '1' ORDER BY nm_nome ASC", "idC={$cond}");
var_dump($Despesas->getRowCount());
?>
<div class="table-responsive">
    <table class="table table-striped table-bordered" id="tb-despesas">
        <thead>
        <tr>
            <th>Conta(s)</th>
            <th>Valor Cobrar</th>
            <th>Valor Real</th>
            <th>Referente</th>
            <th>Consumo</th>
            <th>Medidas</th>
            <th>Obs.</th>
        </tr>
        </thead>
        <tbody>
        <?php
        foreach($Despesas->getResult() as $Despesa):
        ?>
            <tr>
                <input name="id_despesa[]" type="hidden" value="<?=$Despesa['id'];?>"> //Aqui passo um hidden pois faço uma verificação depois do ID correto
                <td><?=$Despesa['nm_nome']?></td>
                <td><input name="vl_valor[]" class="form-control" type="number"></td>
                <td><input name="vl_valorreal[]" class="form-control" type="number"></td>
                <td><input name="nm_referencia[]" id="dt" class="form-control" onkeypress="mascara(this, '##/####')" type="text"></td>
                <td><input name="consumo[]" class="form-control" type="text"></td>
                <td><input name="medidas[]" class="form-control" type="text"></td>
                <td><input name="obs[]" class="form-control" type="text"></td>
            </tr>
        <?php
        endforeach;
        ?>
        </tbody>
    </table>
</div>

I send this via POSTto the same page where I’m treating and then recording in the database. Then the confusion begins. In a specific search, I get 160 results, but when I treat after the post I’m getting only 143, when I try to get the latest results is giving offset errors because it does not exist.

When I do another operation where I get less ratings in my 50s, everything works great =P

I’ve even changed my post_max_size among other points in php.ini, but I don’t think there are so many results to reach the limit.

Does anyone have any idea if this is really some post submission limit or am I missing somewhere?

1 answer

0


At the end the problem was actually in apache. A line called max_input_vars was commented on in the file php.ini.

Removing the comment worked normally. The full line on php.ini is like this:

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

Browser other questions tagged

You are not signed in. Login or sign up in order to post.