PHP Classes

Trigves Arm: Create database tables from array

Recommend this page to a friend!
  Info   Documentation   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: 132 All time: 9,326 This week: 455Up
Version License PHP version Categories
trigves-arm 1.0The PHP License5PHP 5, Databases
Description 

Author

This class can create database tables from array.

It takes an array with the definition of database tables and executes SQL statements to install the defined tables in MySQL database using MySQLi.

The class checks for existing tables to determine if the listed tables already exist and may need to be altered, or just creates the tables.

Picture of Trigve Hagen
Name: Trigve Hagen <contact>
Classes: 2 packages by
Country: United States United States
Age: ???
All time rank: 4273543 in United States United States
Week rank: 164 Up23 in United States United States Up

Documentation

trigves-arm

This is a Rapid Application Development tool designed to speed up the work flow by taking out the need to run back and forth from the database. It works on database tables and rows by mapping a multidementional array to the relational database the same way an Orm maps an object. Once installed place the $this_>ArmCheckTables(); function somewhere where it will be ran everytime your page refreshes. If updates are needed it does them automatically.

YOU REALLY HAVE TO WATCH WHEN YOU ARE CREATING YOUR TABLES AND FIELDS * WHEN FIRST PUT INTO USE IT WILL ERASE ANYTHING DONE BEFORE IT AND CREATE A SAMPLE USER DATABASE * NAMING TWO ROWS THE SAME WILL HALT EXECUTION AND CREATE AN ERROR * NAMING TWO TABLES THE SAME WILL HALT EXECUTION AND CREATE AN ERROR * DATABASES SOMETIMES ONLY ALLOW A TOTAL NUMBER OF VARCHAR CHARACTERS IN A TABLE - THE ARRAY WON'T UPDATE THE DATABASE IN THIS CASE * WHEN QUERYS ARE RAN ON THE DATABASE THE DATABASES TURNS UPPERCASE TO LOWER CASE. THEN WHEN CHECKED AGAINST - $_tablesArray (UPPER CASE) AGAINST THE DATABASE ARRAY(LOWWER CASE) IT RETURNED NOT IN THE ARRAY AND DELETED THEM BOTH. - users_c3p0r2d2007OG - has to be users_c3p0r2d2007og

I take no responsibility for lost data! Use at your risk. Happy Coding!!

INSTALLATION 1) Put class where you can inherit it through extends or include it. 2) Fill in database connection variables,

private $_db_host;  
private $_db_name;  
private $_db_user;  
private $_db_pass;  

3) Call $this->ArmCheckTables();

3/10/2017 - updates * added support for adding multiple rows in a table that are next to each other. * added support for droping unneeded tables - just erase them from the array.

3/13/2017 - updates * added support for changing row names * added error reporting


  Files folder image Files (2)  
File Role Description
Plain text file Arm.php Class Class source
Accessible without login Plain text file README.md Doc. Documentation

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  
 100%
Total:132
This week:0
All time:9,326
This week:455Up