“Hezecom PHP Code Generator ” Documentation by “Hezecom” v1.0

“Hezecom PHP Code Generator”

Created: 22/11/2012
By: Hezecom
Email: info@hezecom.com

If you have any questions that are beyond the scope of this help file, please feel free to email via my user page contact form here. Thanks so much!

Table of Contents

  1. What is Hezecom PHP Code Generator
  2. Quick Start
  3. Database Settings
  4. Generating Code
  5. Files to include
  6. Class Usage Example


Hezecom PHP Code Generator is a PHP, MySQL and PDO code generator which generate classes for each table in your database. Its aim is to speed up your application development process. All you need to do is just create your database and the Code Generator will generate the classes which consist of INSERT, UPDATE, SELECT and DELETE which are the major database operations, not only that, it will also generate stylish CSS3 forms for INSERT and UPADATE, and also generate stylish CSS3 grid table to view all records and CSS3 table to view a single record based on the table name selected.

The generated classes are commented for easy understanding base on their operations, which means editing the code to your taste is very simple, if necessary. If you have not started using OOP in php, this will be a good starting point for you and if you have whao! Then enjoy the power of speed using this app to generate sophisticated code for your projects. Save time and money developing your app with just few clicks is so amazing and fun.


  1. Generate Data Access Layer Classes in PHP for MYSQL Tables
  2. Generate PDO data objects class for each table
  3. Generate MySQL objects class for each table
  4. Generate stylish CSS3 design forms for INSERT and UPDATE
  5. Generate stylish CSS3 grid table to view all records (support 4 links to add/update/view/delete)
  6. Generate stylish CSS3 table to view single record
  7. Option to choose either PDO or MySQL data layer support
  8. The generated PDO classes support multiple datable e.g. SQLite, Oracle, SQL Server...etc.
  9. Generate a single class and form for each table
  10. Four database operation are generated for each table which include
  11. The generated code work instantly after clicking on the Generate button
  12. Option to preview your generated code instantly without any adjustments
  13. Build in self-defined functions
  14. Just copy the generated folder to use with your project (PDOclass/ or MySQLclass/)
  15. Generated codes are easy to customize when necessary depending on your project requirements.
    There are other exciting features...


This guide covers both MySQL and PDO option.
Create MySQL database with table. E.g.

Unzip the CodeGen folder to your web directory and run it.
E.g. http://localhost/CodeGen

C) Database Settings - top

Complete your database settings example is shown below

D) Generating Code - top

Select a table you want to generate code for and click on the Generate button that’s all. Whether you are using MySQL or PDO data support layer is the same process. Example is shown below:
When you click on the Generate Codes button you will receive this message. You can click on the Preview Code Output link to see your generated code in action.

NOTICE: The aid on the form field is a primary key from the database above. It must be same with the database else your code will not work well.

Code Output
Your generated code will be found in the folder named CodeOutput copy either PDOclass or MySQLclass folder depending on the option you selected and paste to anywhere you want to use it. It’s that simple.
IMPORTANT! Please don’t use the two options i.e. PDOclass and MySQLclass together; you can only use one option at a time.
I Recommend PDO for you, because the generated codes support multiple databases.

Whether you use PDOclass or MySQLclass the folder contain the following files and folders:

The database settings is located in the lib/config.php you can adjust if need be.

The classes/ folder contains all your classes. You can adjust any class if you feel like. Note that the PDO output class is slightly different from MySQL output class. e.g.

PDO and MySQL class example

PDO insert example

PDO select one record example

MySQL insert example

MySQL select one record example

You can further customize the SQL queries to suit your project requirements.

NOTICE: The sanitize and post are self-functioned functions used located at lib/functions.php. The sanitize function handles SQL injection, I didn’t use for PDO class because I am using PDO prepared statements which already handle SQL injection.

E) Files to include - top

PHP files
The files to include wherever you want to use the code generated by Hezecom Code Generator you must include the following files:

For MySQL include the following as shown below:

For PDO include the following as shown below:

The classes/class_accounts.php is just example of how to include the class generated the name changes depending on the name you give to the class from the class field. But the other three above remain like that.

CSS File
This is just a single file in a folder called css/
Add it between the <head> and </head> in your html code like this:
 <link rel="stylesheet" type="text/css" href="css/bootstrap.css" media="screen" />

Although all this has already been done for you by Hezecom Code Generator, so don’t worry about including anything, all you have to do is copy either the PDOclass or MySQLclass folder to your project location. That’s all.

F) Class Usage Example for (SelectAll and Delete) - top

View All Records Example

Please check the demo for more examples.


  • PHP 5+ and MySQL 4+
  • PDO driver should be enabled if not already enabled.

  • Once again, thank you so much for purchasing this app. For more information contact


    Copyright 2012 Hezecom Technologies

    Go To Table of Contents