i'm having one table like
name | age
abc | 20
pqr | 30
I want result in json array like
{
[{
"name":"abc",
"age":20
},
{
"name":"pqr",
"age":30
}]
}
I know their is method
row_to_json();
that will be give me only single row of json but i want array, please help me on this