s22 Tech

Useful code.

PHP code to display MySQL data in an HTML table

Display any data in a nicely formatted way.

Change the fields in the PHP script below to the fieldnames from your MySQL db. Shown below the code is the actual output to show you what it generates.

This script is offered 'as-is' and is unsupported.



Example output:

Page Hit Counter
Page Name No. of Hits
index.html 263
page_1.html 40
page_2.html 33
page_3.html 74
page_4.html 5
  If you want text in a footer that spans the entire table, place it here.