PHP Classes

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

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

Author

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: 414472 in Indonesia Indonesia
Week rank: 197 Up5 in Indonesia Indonesia Up

Example

<?php
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");
$db->showtabel();
?>


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

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 0%
Total:200
This week:0
All time:8,481
This week:74Up