View Single Post
Old 12-11-2012, 06:13 PM   PM User | #5
felgall
Master Coder

 
felgall's Avatar
 
Join Date: Sep 2005
Location: Sydney, Australia
Posts: 5,454
Thanks: 0
Thanked 498 Times in 490 Posts
felgall is a jewel in the roughfelgall is a jewel in the roughfelgall is a jewel in the rough
If your starting point is a database and your end point is an HTML table then there is no need to go through a third format for the data in between for just a server side application.

The only reason for deciding to use JSON as an intermediate format is if you are going to set up so that the table can be dynamically updated from the database without reloading the page.

That would require a server side script that reads the data from the database and generates JSON instead of a web page AND it would require JavaScript that calls the server side script and then loads what it receives as JSON into the HTML table either in place of what is already there or as extra rows.

For a simple example of the JavaScript needed to retrieve JSON from the server and soncert it into a format that JavaScript can then process further see http://javascriptexample.net/ajax04.php
__________________
Stephen
Learn Modern JavaScript - http://javascriptexample.net/
Helping others to solve their computer problem at http://www.felgall.com/
felgall is online now   Reply With Quote