Results 1 to 3 of 3

Thread: json encode data

Hybrid View

  1. #1
    Join Date
    Jul 2005
    faisalabad, punjab, pakistan

    json encode data

    hi how can i generate the following code example from php/mysql result set?

    PHP Code:

    echo json_encode(array(
    'title' => "Event1",
    'start' => "2013-02-10"
    'title' => "Event2",
    'start' => "2013-02-20"

  2. #2
    Join Date
    Aug 2004
    Load the result data into a 2-D array (details will depend on what DB extension you are using), then json_encode() that array.
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    How to Ask Questions the Smart Way (not affiliated with this site, but well worth reading)

  3. #3
    Join Date
    May 2003
    Also remember that json_encode() is fairly new and may not be included in your php install...i've ran into this a few times before, in which case there are some other functions and classes available to handle the task.
    We do precision guesswork

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center

Recent Articles