Location: PHPKode > scripts > Encaps Gallery > encaps-2.3.22s/admin/catalog_db_deinstall.php
<?php 
include("common.ini.php"); 
include("catalog_head.html");

if(@$config['demo']=='Y'){
	echo '<h1>Read-only demo</h1>';
	return;
}
include('../config.ini.php');
// ------------------- check connection ------------------- //
if (@mysql_connect($config['db_host'],$config['db_user'],$config['db_pass']))
{
	if (@mysql_select_db($config['db_name']))
	{
		if( @$_POST['action'] != 'deinstall_submit')
		{
			?><form method="post" action="">
			<h2 style="color:#FF0000">Are you sure to deinstall Encaps database tables?</h2>
			<input type="submit" value="               Submit deinstall               ">
			<input type="hidden" name="action" value="deinstall_submit">
			</form><?php 
		}
		else
		{
			$db = new DB_sql(@$config["db_host"],@$config["db_user"],@$config["db_pass"],@$config["db_name"]);
			$sql[] = "DROP TABLE IF EXISTS ".$config["db_prefix"]."base_items;";
			$sql[] = "DROP TABLE IF EXISTS ".$config["db_prefix"]."catalog_categs;";
			$sql[] = "DROP TABLE IF EXISTS ".$config["db_prefix"]."catalog_items;";
			$sql[] = "DROP TABLE IF EXISTS ".$config["db_prefix"]."shopcart;";
			$sql[] = "DROP TABLE IF EXISTS ".$config["db_prefix"]."test;";
			$res_install = true;
			foreach($sql as $query)
				if(!$db->query($query))
				{
					Misc::_show_message_color("SQL query failed: $query","YELLOW");
					$res_install = false;
				}
			if(!$res_install)
				Misc::_show_message_color("Error on deinstalling Encapsdatabase tables","RED");
			else
			{
				Misc::_show_message_color("Database is deinstalled successfully","GREEN");
			}
		}//if( @$_POST['action'] != 'install_submit')
	}//if (@mysql_select_db($config['db_name']))
	else 
	{
		$error['db_name'] = 1;
		Misc::_show_message_color("Unable to connect the database ".$config['db_name'],"RED");
	}
}//if (@mysql_connect($config['db_host'],$config['db_user'],$config['db_pass']);)
else 
{
	$error['db_sup'] = 1;
	Misc::_show_message_color("Unable to connect the database host ".$config['db_host']." with username ".$config['db_user']." and password ".$config['db_pass']."","RED");
}

include("catalog_foot.html");
?>
Return current item: Encaps Gallery