#
/**
	This script will attempt purge the current database,

	It then source the file fruit5TablesAltered.sql
	on PMA (PHPMyAdmin) you cannot run source commands we input them.
        this file then runs a check table command

	in PHPMyAdmin
  1. first drop all your database tables
  2. then import fruit5TablesAltered.sql You will have a new fruit database, you just need to add the two views
if you read code you will notice most of the purging was dropped, had problems with syncing. first disable the referential integrity drops all procedures,functions and events created in pma Video Sequence if then call fruitShared.purgeDatabase( 'databasename' ) which drop all tables, views and foreign key constraints @author Professor Tom DeDonno @version Written 01/12/2014 updated 8/2015 updated 8/20, 10/23 */ # cannot source from phpMyAdmin #source /home/premiere/public_html/fruit5Tables.sql.html #source /home/premiere/public_html/fruitAlter.sql.html #phpMyAdmin doesn't allow me to create the five tables with a single import # you get command out of sync #call `fruitShared`.create5FruitTables( database() ); /* SET FOREIGN_KEY_CHECKS = 0; drop function if exists getImageURL; drop procedure if exists orderInvoiceSimple; drop procedure if exists orderInvoice; drop procedure if exists dropAllTables; drop procedure if exists updateInventory; drop event if exists oneTime; drop function if exists testFruitExistence; drop procedure if exists testFruitTransaction; drop procedure if exists testTransaction; drop procedure if exists updateShipDate; SET FOREIGN_KEY_CHECKS = 1; need to put the call last something strange is happening with phpMyAdmin and comment lines getting out of sync in pma, also check source for permission invoker, sql data #call `fruitShared`.create5FruitTables( database() ); */ /** this procedure will drop all tables, compensates if user has enter a bad table name but remember specifications matters, so this #call `fruitShared`.`purgeDatabase`( database() ); */ # for premiere import the source command is changed to a select display # you cannot source from within pma, especially to a file outside its root folder, why? source /home/premiere/public_html/fruit5TablesAltered.sql.html; check table customer, fruit, inventory, orders, orderLine;