PHP Classes
elePHPant
Icontem

File: add.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Przemek Berezowski  >  DB Version Manager  >  add.php  >  Download  
File: add.php
Role: Example script
Content type: text/plain
Description: Adds a query to list and execute it
Class: DB Version Manager
Update database schema with commands read in files
Author: By
Last change:
Date: 4 years ago
Size: 667 bytes
 

Contents

Class file image Download
<?php
/**
 * File for handling adding new queries from GUI
 */
require('profile.php');
require(
'lib/config_manager.php');
require(
'lib/db_updater.php');

if (!empty(
$_POST['commands'])) {
   
   
$oConf = new ConfigManager(CURRENT_PROFILE);
   
$oDbUpdater = new DbUpdater($oConf);
   
   
$oDbUpdater->prepareFIles($_POST['commands']);
   
   
//@TODO add host path
   
header('Location: update.php');
}


?>

<html>
    <head>
    <title>Add new commands</title>
    </head>
   
    <body>
   
    <form action="add.php" method="post">
   
    <label>Type new sql commands</label><br />
    <textarea rows="30" cols="100" name="commands"></textarea>
    <br />
    <input type="submit" />
   
    </form>
    </body>
</html>