PHP Classes

File: index.php

Recommend this page to a friend!
  Classes of Larry Wakeman  >  DB Schema Management  >  index.php  >  Download  
File: index.php
Role: Example script
Content type: text/plain
Description: Example
Class: DB Schema Management
Dump and update MySQL database schemata
Author: By
Last change:
Date: 9 years ago
Size: 3,331 bytes


Class file image Download
include('dbMaintenence.php'); // load the class
if (isset($_POST['hostname'])) {
$maint = new dbMaintenence($_POST['hostname'],
$_POST['dbprefix']); // initialize the class
<title>Schema Check</title>
<h2 style="text-align: center; margin-top: 30px;">Schema Check Demonstration Script</h2>
if (isset($_POST['extract'])) {
$maint->extract(dirname(__FILE__).'/'.$_POST['filename']); // create an extract file
echo '<h4 style="text-align: center; margin-top: 30px;">Extract Operatiion Complete</h4>';
    if (isset(
$_POST['update'])) {
'<h4 style="text-align: center; margin-top: 30px;">'.$maint->update(dirname(__FILE__).'/'.$_POST['filename']).'</h4>'; // update the database from the extract file
<form name=".Form" action="<?php echo $_SERVER['REQUEST_URI']; ?>" method="post">
<table style="margin-top: 10px; margin-left: auto; margin-right: auto;">
        <td>Host Name:</td>
        <td><input type="text" name="hostname" <?php if (isset($_POST['hostname'])) echo 'value="'.$_POST['hostname'].'"' ?> style="background-color: #BBFFFF;"></td>
        <td>Enter the hostname for the database server</td>
        <td>User Name:</td>
        <td><input type="text" name="username" <?php if (isset($_POST['username'])) echo 'value="'.$_POST['username'].'"' ?> style="background-color: #BBFFFF;"></td>
        <td>Enter the username for the database server</td>
        <td><input type="text" name="password" <?php if (isset($_POST['password'])) echo 'value="'.$_POST['password'].'"' ?> style="background-color: #BBFFFF;"></td>
        <td>Enter the password for the database server</td>
        <td>Database Name:</td>
        <td><input type="text" name="database" <?php if (isset($_POST['database'])) echo 'value="'.$_POST['database'].'"' ?> style="background-color: #BBFFFF;"></td>
        <td>Enter the database name to extract of update</td>
        <td>Table Prefix:</td>
        <td><input type="text" name="dbprefix" <?php if (isset($_POST['dbprefix'])) echo 'value="'.$_POST['dbprefix'].'"' ?> style="background-color: #BBFFFF;"></td>
        <td>Enter the table prefix if applicable for the extract or update</td>
        <td>File Name:</td>
        <td><input type="text" name="filename" <?php if (isset($_POST['filename'])) echo 'value="'.$_POST['filename'].'"' ?> style="background-color: #BBFFFF;"></td>
        <td>Enter the extract file name. The file must be in the same directory as this script.</td>
        <td colspan=3 style="text-align: center;">
            <input type="submit" name ="extract" value="Extract">
            <input type="submit" name ="update" value="update">

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