0
So I’m having a little problem with my code, query, for, foreach and if work perfectly. However, file_put_contents only writes half of the reported data. My goal with this code is basically to make a query of the bank, return the result and in array to be converted into json and be divided by the 'assembler_idmontadora' with the vehicle models corresponding to each automaker. Down with the Code I’m trying to make :
My Class:
And finally my crud job:
This may be happening because the
foreach
is passing more than once with the same counter$i
. (As I don’t know your logic, it seems to me this). You can also use this way:file_put_contents(file, data, FILE_APPEND);
to add, rather than replace the content.– Valdeir Psr
Hello @Henrique. Avoid placing images of your code, instead edit your question and place the structured code there.
– João Martins