PHP Classes

File: example.php

Recommend this page to a friend!
  Classes of Alexandru Trandafir Catalin   Auto DB Up   example.php   Download  
File: example.php
Role: Example script
Content type: text/plain
Description: This code must be included into all the pages of your application.
Class: Auto DB Up
Update a MySQL database from SQL files
Author: By
Last change:
Date: 13 years ago
Size: 508 bytes
 

Contents

Class file image Download
<?php

# Include the script.
include_once('AutoDbUp.php');

# Load the script and specify the path where all sql files are saved,
# the files inside that directory must contain numeric names and increasing
# that will be the revision number of your database, example:
# 1.sql, 2.sql, 3.sql, 4.sql, 5.sql and so on, for each update you make.
$autoDbUp = new AutoDbUp('path/to/sql/files');

# Run the script's upgrade method to search all the new sql files and run them.
$autoDbUp->upgrade();

?>