Location: PHPKode > projects > HypatiaDB > hypatiadb/includes/maint.php
<?
function optimise_table($uDatabase, $uTable) {
	$uDatabase = mysql_real_escape_string($uDatabase);
	$uTable = mysql_real_escape_string($uTable);
	$sql = "OPTIMIZE TABLE `$uDatabase`.`$uTable`";
	if($result = mysql_query($sql)) {
		return $result;
	} else {
		return mysql_error();
	}
}

function analyse_table($uDatabase, $uTable) {
	$uDatabase = mysql_real_escape_string($uDatabase);
	$uTable = mysql_real_escape_string($uTable);
	$sql = "ANALYZE TABLE `$uDatabase`.`$uTable`";
	if($result = mysql_query($sql)) {
		return $result;
	} else {
		return mysql_error();
	}
}

function check_table($uDatabase, $uTable) {
	$uDatabase = mysql_real_escape_string($uDatabase);
	$uTable = mysql_real_escape_string($uTable);
	$sql = "CHECK TABLE `$uDatabase`.`$uTable`";
	if($result = mysql_query($sql)) {
		return $result;
	} else {
		return mysql_error();
	}
}

function repair_table($uDatabase, $uTable) {
	$uDatabase = mysql_real_escape_string($uDatabase);
	$uTable = mysql_real_escape_string($uTable);
	$sql = "REPAIR TABLE `$uDatabase`.`$uTable`";
	if($result = mysql_query($sql)) {
		return $result;
	} else {
		return mysql_error();
	}
}

?>
Return current item: HypatiaDB