0
It all comes down to this image:
The problem is in the JSON mount, it does not group the first result and assigns an array to the dates, as it should be in the image below:
Is there a plugin in mysql or api in php that solves this problem, mount json or Gjson from a 1-N-related data set:
How to do this?
I used php to exemplify what I want, however you can see that php does nothing else, it only displays the result of the query, I want to do the data manipulation in the query, but if it is not possible, the php solution will be welcome. : D
Doesn’t seem wrong, there are 2 Milrak so the date array. Show your query.
– Papa Charlie
@Papacharlie there are no two Milrak in the Pessoa table, but two milrak entries on the inscription table. Actually the query returns two lines from it, however I would like the json to group in a single object milrak that would have two dates understands?
– Milrak Pereira Pessoa
Enter the code
php
you’re using.– Edilson
@Edilson I’m only using Mysql, functions like JSON_ARRAY and JSON_OBJECT. I don’t know solution in php for the problem. :/
– Milrak Pereira Pessoa
Edit the question, and place the part of the code responsible for generating this sequence.
– Edilson
@Edilson doesn’t know which title to change to, so it stays the same and I added the code that makes the sequence.
– Milrak Pereira Pessoa
Posts code as text, not as image.
– Inkeliz