APPLY FOR ONLINE Zend Framework Certification

                    
                        <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="font-size:16px"><strong>How to Display data from database in JSON format using Ajax and PHP</strong></span><br />
<br />
A very common use of JSON is to read data from a web server and then display these data into a web page.</p>

<p>JSON is text, so when we want to exchange text as data between a browser and web server we can use JSON. In this tutorial, I will teach you how to get data from database in JSON format using Ajax and PHP. PHP has some default functions which can easily handle any JSON string. json_encode() function converts any PHP objects into JSON. Similarly, json_decode() function converts any JSON into PHP array object.</p>

<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong> So, for better understand, follow the following example, it will help you to know how to get data from</strong></p>

<p>database in JSON format using Ajax and PHP. In this example, we will insert a roll number in the input box, it returns corresponding student details from the MySQL database in JSON format and displays in the web page.</p>
                    
                


Comment


Back to Top