PHP Classes


Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in Bookmark in
  Classes of Manuel Gonzalez  >  PHP HTML Database  >  >  Download  
Role: Documentation
Content type: text/plain
Description: Auxiliary data
Class: PHP HTML Database
Generate HTML from query results programmatically
Author: By
Last change:
Date: 2 years ago
Size: 3,051 bytes


Class file image Download

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...?"


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

  - 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. 

  include_once 'html.class.php';
  $p = new PHP2HTML();
  $p->Body('<div>Hello World</div>');
  $p->Comment("Begin of imported file");
  $p->Comment("End of imported file");
  $p->Body($p->Link(PAGEF, "","Google","_blank"'));
            "button", "Click Me", "myClass", "myID", "myName",
              'alert("Hello"); return false;'

Database connections example
    $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
      //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');

      //Returns the number of affected rows on success
      $NumRecords = $p->Cnn->affectedRows();
     echo "The statement affect $NumRecords rows";
Constructive critics, comments and suggestions are welcome.