Location: PHPKode > projects > Test Suites Results Parser and Browser > tslogparser-v07/db/remove_db_data.inc.php
<?php
/*
 * Copyright (c) 2005, Bull S.A..  All rights reserved.
 * Created by: Sebastien Decugis
 
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of version 2 of the GNU General Public License as
 * published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it would be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write the Free Software Foundation, Inc., 59
 * Temple Place - Suite 330, Boston MA 02111-1307, USA.
 */

/*
 This file defines the function remove_db_data()
 which will delete all the tslogparser database data.
 
 USE WITH CARE!!
*/
function remove_db_data()
{
	$res=0;
	$tables=array(
		 "opts_config"
		,"opts_domains"
		,"opts_routines"
		,"opts_assoc_dom_rou"
		,"opts_assertions"
		,"opts_versions"
		,"opts_version_descriptions"
		,"opts_run"
		,"opts_run_results");
	foreach ($tables as $table)
	{
		$sql = "DROP TABLE ".$table;
		$tmp = mysql_query($sql);
		if ($tmp)
		{
			$res++;
		}
	}
	return  "<b>".$res." / ".count($tables)."</b> table(s) removed.";
}
?>
Return current item: Test Suites Results Parser and Browser