Our today post will focus on how to retrieve information from our database and print it in json file
Opening database retrieve user profile and print in json file
In our previous discussion we showed you how to store information in database and display it on html stream. Now, we will implement how to print users details to json file. The below code, you can copy and paste or write it manually for your testing. Copy the below code save it as jsontest.php and run it. if you see message "Success!" this means our profile details was successfully created and printed to json file.
Json data contains our user profile details from database
Now, in the current folder locate the created file "data.json" right-click and open it in notepad. This is our profile information from our database table. Today you have had experience on how to generate user information and store it in json file.
Summary
While following our tutorials, if our code spot error, don't hesitate to get in touch you can also request a certain some piece of code and we will craft it for you. In our shop we focus on creating, testing and debugging. Thanks for reading this article.
Comments