PHP Classes

PHP HTML Database: Generate HTML from query results programmatically

Recommend this page to a friend!
  Info   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: 332 All time: 7,129 This week: 31Up
Version License PHP version Categories
html-database 1.0.1MIT/X Consortium ...5.2.3HTML, PHP 5, Databases
Description 

Author

This package can generate HTML from query results programmatically.

The base class can generate HTML pages by composing the different page tags from parameters like page CSS, JavaScript, meta tags, comments, forms, tables, etc..

It can also generate listings from database query results using separate classes.

Currently several databases supported like MySQL, SQL Server and Oracle.

Picture of Manuel Gonzalez
  Performance   Level  

 

Details

php2html ======== Write HTML using only php About the project ================= One advantage of the dynamic pages and client server languages, is the ability to create multiple contents using the same code. In combination with databases, the possibilities for creating content, grow and can facilitate or complicate the existence of a programmer. The main idea of this project, is precisely to facilitate the generation of these contents when the origin of these come from different sources. This project was done in my spare time. Not intended to replace the good programming practices, and serve as a example for stable development. The project is the result of a question "what if...?" Features ======== The PHP2HTML class, integrates engine access to MySQL, SQL Server and Oracle. Allowing the automation of building several web pages, using the same code. It allows to integrate in a same page from different sources. For example, the menu can be in a text file, get the main page from a MySQL database and other items are stored at Oracle database - Import CSS/JS/Text/Php Files - Use the same methods to access different RDBMS - Common methods to build most used tags - Object-oriented - Automate events Requirements ============ - PHP 5.2 or higher - MySQL 4.1 or higher - Oracle 9 or higher - Microsoft SQL Server 2000 or higher The use of Oracle is not limited to full versions. XE versions are supported. To use the mysqli extension, you must have installed mysql 4.1 or higher. Example ======== ```php include_once 'html.class.php'; $p = new PHP2HTML(); $p->CSS('css/styles.css'); $p->Body('<div>Hello World</div>'); $p->Comment("Begin of imported file"); $p->HTML('contents/table.html'); $p->Comment("End of imported file"); $p->Body($p->Link(PAGEF, "http://www.google.com","Google","_blank"')); $p->HTMLbr(); $p->Body( $p->Btn( "button", "Click Me", "myClass", "myID", "myName", actions::onClick( 'alert("Hello"); return false;' ) ) ); $p->Create(); ``` Database connections example ==================== ```php $p->setConnType("mysql"); $p->setConnection($dbHost, $db_User, $db_Pass, $db_Database); //Running a SELECT statement $p->Cnn->Query('Select code, name from myTable'); //The result of the query can be accessed via Cnn->rs method If(!$p->Cnn->rs==false){ //The numRows() method returns the number of rows for a SELECT query $NumRows = $p->Cnn->numRows(); echo "The statement return $NumRows records"; } //Running a Delete statement $p->Cnn->Query('delete from myTable where code = 101'); if($p->Cnn->rs){ //Returns the number of affected rows on success $NumRecords = $p->Cnn->affectedRows(); echo "The statement affect $NumRecords rows"; } ``` Contact ======= Constructive critics, comments and suggestions are welcome. phptohtml@gmail.com Homepage ==== [http://www.php2html.comyr.com](http://www.php2html.comyr.com)

Screenshots (2)  
  • database
  • example
  Files folder image Files (15)  
File Role Description
Accessible without login Plain text file actions.class.php Class Class source
Accessible without login Plain text file html.actions.php Aux. Auxiliary script
Accessible without login Plain text file html.attributes.ext.php Aux. Auxiliary script
Accessible without login Plain text file html.attributes.php Aux. Auxiliary script
Accessible without login Plain text file html.class.php Class Class source
Accessible without login Plain text file html.def.php Conf. Configuration script
Accessible without login Plain text file MIT-LICENSE.txt Doc. Documentation
Accessible without login Plain text file mssql.class.php Class Class source
Accessible without login Plain text file mysql.class.php Class Class source
Accessible without login Plain text file mysqli.class.php Class Class source
Accessible without login Plain text file oracle.class.php Class Class source
Accessible without login Plain text file README.md Doc. Auxiliary data
Accessible without login Plain text file sqlfunctions.class.php Class Class source

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  
 86%
Total:332
This week:0
All time:7,129
This week:31Up