Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript MySQL to JSON tips

  • This topic is empty.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #43374

    What have you found to be the easy way to export a MySql data into JSON fromat?

    I was going to write Ruby script, but thought I would see if anyone had a better suggestion since my ruby experiences is limited.

    Note to self:

    Brush up on Ruby Today! Tomorrow.

    #128128
    __
    Participant

    are you familiar enough with Ruby to do this quickly? any other language?

    What you’re most comfortable/capable with is going to be a big factor. I, for example, would use PHP because that’s my strongest suit.

    Do you have a particular way you want to format the information?

    #128141

    Sorry should have went into to more detail.

    Example… write a script that when called with javascript will query a database, output the data to a formated .json document that can be returned to a Javascript callback function (your standard ajax).

    I would usually do this in PHP, but was just wondering if anyone who had experience with Ruby or Python, thought it was more efficient than PHP for larger scale mobile projects.

    I would not mind brushing up on Ruby or learning Python just have not got around to it.

    #128148
    __
    Participant

    > …thought it was more efficient than PHP for larger scale mobile projects.

    if it’s well-coded, you’d need to get pretty “large” before you notice – regardless of which language you choose.

    If you’re looking for a learning experience, I’d say python. That’s my next challenge. I already love it.

    What about the data structure, though? Are you modeling the info, or just passing the raw data? Including column names? Just a list of row objects?

    #128154

    Where the question came from, I started developing a mobile app using [phonegap](http://phonegap.com/ “Phone Gap”) which has been working great.

    However, I’m limited to only to using xmlhttprequest to talk with the server.

    I’m not using any data modeling for the json, I’m just using JSON.parse function

    I do like the idea of data modeling and I have also considered JSON templating.

    #128155
    Alen
    Participant

    Is this for a web application? [Are you just looking to interact with the database; CRUD?](http://en.wikipedia.org/wiki/Create,_read,_update_and_delete)

    I don’t think you should reinvent the wheel.

    Choose:
    [Ruby on Rails](http://rubyonrails.org/) ( Ruby ),
    [Django](https://www.djangoproject.com/) ( Python ),
    [Express](http://expressjs.com/) ( Node ),
    [Laravel](http://laravel.com/) (PHP).

Viewing 6 posts - 1 through 6 (of 6 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.