Skip to content

gautamkrishnar/unijson.php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

Unijson.php

Universal PHP script to generate JSON from any MySQL database. unijson.php is a PHP script that can convert any existing database into JSON format easily. It is well documented and customizable (See the inline comments in the code). App developers can customize the code and use it as a backend for their applications. No need to learn PHP anymore 😉.

How to use unijson.php

Simply copy the unijson.php to your server, edit the line below and add your MySQL database credentials:

$db='database'; // Database Name
$table='table'; // Table Name
$host='db_host'; // Database Host
$usn='db_user'; // Database User
$pss='dc_password'; // Database Password

What is unijson.php

Unijson.php will convert any existing MySQL database into JSON format. See an example below:

Using unijson.php on the dataabase below

name email phno
test test@test.com 123456
test2 test2@test.com 123456
test3 test3@test.com 123456

Will produce the following output:

[{"json_uuid":0,"name":"test","email":"test@test.com","phno":"123456"},
{"json_uuid":1,"name":"test2","email":"test2@test.com","phno":"123456"},
{"json_uuid":2,"name":"test3","email":"test3@test.com","phno":"123456"}]

Features

  • Easy to use, No need to learn PHP
  • Fully documented source code
  • JSON Prettify function

To Do

  • Add ability to change the DB column names on JSON output

License

MIT License

About

A universal PHP script to generate JSON from any MySQL database

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages