Table from Insert: Generate create table SQL from an insert query

Recommend this page to a friend!
  Info   Example   View files (21)   Download .zip   Reputation   Support forum (1)   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 486 All time: 5,822 This week: 372
Version License PHP version Categories
table-from-insert 0.5GNU General Publi...3.0Databases, Text processing
Description Author

This class can generate create table SQL from an insert query.

It takes as parameter a SQL statement of a query to INSERT a table record.

The class builds a SQL query statement to create the given table from the field names used in the INSERT query. It parses the SQL INSERT query to extract all the field names and types.

Innovation Award
PHP Programming Innovation award nominee
February 2014
Number 6
If you have a SQL INSERT query complete with all the fields names and values, you may recover the structure of that table from the query.

This class can do that by parsing the SQL INSERT query and generating a CREATE TABLE statement with all the field names and types based on the parsed query values.

Manuel Lemos
Picture of Elminson De Oleo
  Performance   Level  
Name: Elminson De Oleo <contact>
Classes: 5 packages by
Country: United States United States
Age: 40
All time rank: 2592329 in United States United States
Week rank: 261 24 in United States United States
Innovation award
Innovation award
Nominee: 2x

File Role Description
src (1 file)
testfiles (1 file)
tests (1 file, 3 directories)
.travis.yml Data Auxiliary data
composer.json Data Auxiliary data
example.php Example example using the class
phpunit.xml Data Auxiliary data Data Auxiliary data
table_from_insert.class.php Class class generate sql table sql from insert sql
test.php Example Example script

  Files  /  src  
File Role Description
   SqlToTable.php Class Class source

  Files  /  testfiles  
File Role Description
   test.txt Doc. Documentation

  Files  /  tests  
File Role Description
css (7 files)
fonts (1 file)
js (3 files)
   index.php Example Example script

  Files  /  tests  /  css  
File Role Description
   bootstrap-theme.css Data Auxiliary data Data Auxiliary data
   bootstrap-theme.min.css Data Auxiliary data
   bootstrap.css Data Auxiliary data Data Auxiliary data
   bootstrap.min.css Data Auxiliary data
   table_from_insert.class.php Class Class source

  Files  /  tests  /  fonts  
File Role Description
   glyphicons-halflings-regular.svg Data Auxiliary data

  Files  /  tests  /  js  
File Role Description
   bootstrap.js Data Auxiliary data
   bootstrap.min.js Data Auxiliary data
   npm.js Data Auxiliary data

 Version Control Unique User Downloads Download Rankings  
This week:0
All time:5,822
This week:372
User Comments (1)

For more information send a message to info at phpclasses dot org.