Location: PHPKode > projects > PHP SQL tools > prfile/themedefault.php
<?
include("identify.php");
load_all("themedefault",1,1);

if ($flag == "global") {
	$table_name = "themes";

	$sql = "UPDATE $table_name
		SET
		default_theme = 0	
		WHERE default_theme = 1
	";

	$result = @mysql_query($sql, $main_settings->connection) or die("Couldn't execute query.");


	$sql = "UPDATE $table_name
		SET
		default_theme = 1	
		WHERE id = $edit_id
	";

	$result = @mysql_query($sql, $main_settings->connection) or die("Couldn't execute query.");
}

if ($flag == "local") {
	$table_name = "users";

	$sql = "UPDATE $table_name
		SET
		setting_theme = $edit_id	
		WHERE id = $main_user->id
	";
	$result = @mysql_query($sql, $main_settings->connection) or die("Couldn't execute query.");
}

header ("Location: themes.php");
?>
Return current item: PHP SQL tools