neilfurry Posted December 25, 2015 Share Posted December 25, 2015 hello mate, i need help on creating the json file with data are fetched from mysql database. here will be the result i want to get. { "freebusys":[ { "start":"2012-12-20T16:29:34.000+0000", "end":"2013-02-06T16:44:24.000+0000", "free":true } ], "events":[ { "start":"2013-01-04T03:57:06.000+0000", "end":"2013-02-18T03:57:06.000+0000", "id":2, "title":"A lesson" }, { "start":"2013-01-04T12:43:30.000+0000", "end":"2013-02-18T12:43:30.000+0000", "id":4, "title":"A lesson" } ]} i have a table named "schedules" on my database with the following fields, start, end, id, title, and free, all i need is to do php array "freebusys" and "events" then their values will be fetched from my database. how can i do this. please help. Thank you Quote Link to comment https://forums.phpfreaks.com/topic/299997-please-help-on-fetching-database-data-to-json/ Share on other sites More sharing options...
requinix Posted December 25, 2015 Share Posted December 25, 2015 Given that sample JSON data, what would the table look like? Because I'm not sure that anyone here has any idea what the difference between "freebusys" and "events" is. Quote Link to comment https://forums.phpfreaks.com/topic/299997-please-help-on-fetching-database-data-to-json/#findComment-1528583 Share on other sites More sharing options...
Solution neilfurry Posted December 25, 2015 Author Solution Share Posted December 25, 2015 I already solved this mate. Thank you for your time :-) Cheers! Neil Quote Link to comment https://forums.phpfreaks.com/topic/299997-please-help-on-fetching-database-data-to-json/#findComment-1528592 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.