Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does a MySQL, PHP, JSON framework exist?

I'd like to query a MySQL database via a RESTful service with the middleware being PHP. I'd like the output to be JSON. I'm a beginner in those areas. Are there any frameworks or scripts that can do this without requiring you to be an expert? I don't have a problem stringing a few scripts together if they can work.

Or, if it can be done much simpler without using REST (i.e. query parameters), that's fine.

In the end, I want to have an iPhone app fetch this data and have it returned via JSON. No javascript will be involved.

like image 644
user230949 Avatar asked Dec 16 '09 04:12

user230949


2 Answers

You can convert a MySQL result set to JSON easily: http://phpclasses.nlared.com/browse/package/3195.html

For a RESTful interface, basically any hosted PHP script can function as a REST interface for your application.

like image 101
Cesar Avatar answered Sep 21 '22 23:09

Cesar


Check out this project: http://phprestsql.sourceforge.net/

On this site you will find a RESTful interface (written in PHP) to a database (a MySQL database, but that's not important). Below you will find a interactive tutorial that will get you accessing, adding and deleting rows from our database via our Javascript powered REST browser.

like image 23
James Kolpack Avatar answered Sep 18 '22 23:09

James Kolpack