View Full Version : to send data from php to JSON
Hi ,
I have a php page which contains some data. Now I want to send these data to a grid ie JSON model.
So how should I script the php page 'test.php' so that I could recieve the data in the grid like
JSONDataModel.initPaging("test.php", pageSize);
I mean the format of the php page.
BernardChhun
20 Feb 2007, 4:52 AM
Using Firebug's console to check the XHR call, you can figure it out pretty quickly... :wink:
these steps are ok with the 0.33 grid. NOT THE NEW ONE!
ok here it goes...your PHP page will have to echo JSON or XML formatted data.
so basically the steps are:
1. you make the connection to your database.
2. Make a SELECT statement.
3. Insert every column in an associative array.
4. Convert the data into JSON or XML.
5. bam! there's the data needed for the grid.
Thank u very for the step by step instructions.
but little bit confused with the 4th step ie
"4. Convert the data into JSON or XML."
Where does it occure? in the php page or js ?
How can I pass the data from an associative array(in the php page) to the "JSON code"?
cbetancourt
20 Feb 2007, 5:28 AM
See http://www.yui-ext.com/forum/viewtopic.php?t=2853
Powered by vBulletin® Version 4.1.5 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.