Showing posts with label <?. Show all posts
Showing posts with label <?. Show all posts

Friday, May 29, 2015

How to create JSON using data from MySQL database



How to create JSON using data from MySQL database


JSON (JavaScript Object Notation) is more preferred nowadays over XML as it’s lightweight, readable and easily manageable for exchanging data across various platforms.
we’ll see how JSON Data can be created from Employee table stored in MySQL database.

1. Create Employee table in MySQL database.



Create PHP file to read MySQL table and create JSON.get_json.php

DONE



*************************************************************************
 More Advance
If you want to create a API which Provide data on pass parameter then you can use following code:

The following code used in for parameter pass for geting data in json format

http://localhost/test_more_advance.php?no=10

 



Wednesday, May 13, 2015

How to enable PHP short tags?

In php some time you face problem in

<? tag and <?php tag 

the both tag are used in php but sometime <? tag is not working so you get Errors

to solve this error you have to a small change in your php.ini file and you get solution .
   
Set

                            
 short_open_tag=On          
                            
 
in php.ini

And restart your Apache server.
 
 

How to Host a Laravel Project on Hostinger’s hPanel: A Step-by-Step Guide

How to Host a Laravel Project on Hostinger’s hPanel: A Step-by-Step Guide If you're looking to host a Laravel project on Hostinger’s hPa...