Grow your CSS skills. Land your dream job.

MySQL to JSON tips

  • # March 13, 2013 at 8:34 pm

    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.

    # March 13, 2013 at 9:12 pm

    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?

    # March 13, 2013 at 9:53 pm

    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.

    # March 13, 2013 at 11:16 pm

    > …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?

    # March 14, 2013 at 12:28 am

    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.

    # March 14, 2013 at 12:35 am

    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)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".