Re: PHP script after querying a DB [message #175526 is a reply to message #175524] |
Tue, 04 October 2011 01:30 |
Jerry Stuckle
Messages: 2598 Registered: September 2010
Karma:
|
Senior Member |
|
|
On 10/3/2011 8:02 PM, sandreev wrote:
> I am looking for a script that can output the data in the following
> format.
> Basically I am querying a DB to encode the output in a variation of
> JSON format.
>
> {
> "cols": [
> {"id":"","label":"Topping","pattern":"","type":"string"},
> {"id":"","label":"Slices","pattern":"","type":"number"}
> ],
> "rows": [
> {"c":[{"v":"Mushrooms","f":null},{"v":3,"f":null}]},
> {"c":[{"v":"Onions","f":null},{"v":1,"f":null}]},
> {"c":[{"v":"Olives","f":null},{"v":1,"f":null}]},
> {"c":[{"v":"Zucchini","f":null},{"v":1,"f":null}]},
> {"c":[{"v":"Pepperoni","f":null},{"v":2,"f":null}]}
> ]
> }
>
> My approach is to store columns related array in variable1 and then
> rows related array in variable2 and then print both. Any help in this
> regard is highly appreciated.
>
> thank you,
I don't think you'll find anything which will do what you want. But it
shouldn't be very hard to create such a script. What have you tried so far?
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
|
|
|