Jump to content

Please help on fetching database data to json


neilfurry
Go to solution Solved by neilfurry,

Recommended Posts

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

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.