PHP Classes

SQL to HTML Table: Generate HTML tables from SQL query results

Recommend this page to a friend!
  Info   View files Example   Screenshots Screenshots   View files View files (2)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 200 This week: 1All time: 8,481 This week: 74Up
Version License PHP version Categories
sqltotable 1.0.0MIT/X Consortium ...5HTML, PHP 5, Databases


This class can generate HTML tables from SQL query results.

It can execute a given SQL query to retrieve results from MySQL table.

The class renders a HTML table using the query results column names as table headers and the the query result rows as table rows.

Picture of Wisnu Satriyadi
  Performance   Level  
Name: Wisnu Satriyadi <contact>
Classes: 1 package by
Country: Indonesia Indonesia
Age: 32
All time rank: 413972 in Indonesia Indonesia
Week rank: 89 Up4 in Indonesia Indonesia Up


include "db.php";

$db = new showtable;
$db->host = "localhost";
$db->username = "root";
$db->password = "";
$db->db = "aaaa";

$db->sql = "select * from tb_campur";
//$db->thead = array("ID","NAME", "GENDER","ADDRESS", "RT", "RW", "DATE", "NEW ADDRESS", "TYPE");

  • scr
  Files folder image Files  
File Role Description
Plain text file db.php Class Main Class
Accessible without login Plain text file example.php Example example file

 Version Control Unique User Downloads Download Rankings  
This week:1
All time:8,481
This week:74Up