FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » PHP script after querying a DB
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
PHP script after querying a DB [message #175524] Tue, 04 October 2011 00:02 Go to previous message
sandreev is currently offline  sandreev
Messages: 1
Registered: October 2011
Karma:
Junior Member
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,
[Message index]
 
Read Message
Read Message
Previous Topic: Basic php mysql user management (User management in cakephp)
Next Topic: anti aging skin products
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 30 01:38:22 GMT 2024

Total time taken to generate the page: 0.05447 seconds