Sql2Json() Demo

sql2json() converts the result of a SQL query to its equivalent JSON string.

Example

Query : SELECT user_id,user_name FROM dummy_data_users WHERE user_status='1'

JSON :
[
	{"user_id":"1","user_name":"Binny"},
	{"user_id":"2","user_name":"Bill Gates"},
	{"user_id":"3","user_name":"George Bush"},
	{"user_id":"4","user_name":"Secret Agent"}
]
See

Query : SELECT * FROM dummy_data_users WHERE user_id='1'

JSON :
[{
	"user_id":"1",
	"user_name":"Binny",
	"user_email":"myfakeemail@nowhere.com",
	"user_site":"http://www.bin-co.com/",
	"user_info":"Hi!",
	"user_status":"1"
}]
See

JSON String

Eval'ed Data

loading...
Subscribe to Feed