I'm making adjustments to a graphics system, basically there is a query in the database to bring values and popular the chart, but when there is no specific record does not return anything from the database and the graph breaks.
I would like that when there was no record at least it would bring the fields with zeroed values, is it possible?
Note: I use MySQL. The graphs are in JS, after the query I transform it into JSON for the chart to consume.
Example:
select nome from clientes
If you have a record and I convert to JSON it will look like this:
{nome: fulano, nome: ciclano}
But if it does not register, it looks like this:
{}
And I'd like it at least:
{nome: ""}
But I would only be interested if it was a bank solution, I do not know if it is possible.