Automatic Class Generator In PHP With PDO

Automatic Class Generator In PHP With PDO

Screenshots

Overview

Automatically create classes in PHP to connect to the database using PDO. The script creates a class to perform the main functions for manipulating data in the db with the functions of inserting, updating, searching and deleting.

Features

These are the functions that the script generates for earch table of database.

  • getList() - get all rows of the table.
  • loadById($id) - load into object the data from database.
  • insert() - Insert data into database table
  • insertReturningID() - Insert data into database table and return the inserted id.
  • update($id) Update the data from database table.
  • delete($id) Update the data from database table.

Requirements

  • PHP version 7.0 or higher;
  • MySQL 4.x or MySQL 5.x

Instructions

To use the script, unzip the files into a folder called "generate" and place this folder in the folder where the database table classes will be generated.

After placing the files inside the folder "generate" edit the file Sql.php and alter the lines to match the configuration of your database. To do that edit these lines:

const HOSTNAME = "127.0.0.1";

const USERNAME = "root";

const PASSWORD = "123";

const DBNAME = "db_gameplay";

Download

| If the file download error, please contact email: [email protected]