cycle foreach duplicates the inserts to the database

0

I have a JSON that I sent from an android app to a PHP file where I go through it and store it in the PosgreSQL database, the situation is that when there are more than 250 records it always duplicates them ej json takes 300 elements and enters 600, the first 250 enter them well but then enter the 251 then the 1 then 252 then the 2 and so on I get the JSON

$json = file_get_contents('php://input');

I get a JSON that goes inside the general:

$capturas = $obj->pl_capturas_insert;

and I go through it:

foreach ($capturas as $key3 =>$value3) {
        $result3 = pg_query($dbconn,$value3) or die("falla captura");
        //$insertedCapturasArray[]=$key3;   
    }
    
asked by Igmer Rodriguez 19.09.2018 в 18:56
source

0 answers