Location: PHPKode > projects > HuMo-gen > include/database_name.php
<?php
function database_name($tree_prefix,$Taalkeuze) {
	global $db, $dataDb, $language;

	//if (isset($_SESSION['tree_prefix'])){
		$dataqry = "SELECT * FROM humo_trees LEFT JOIN humo_tree_texts
			ON humo_trees.tree_id=humo_tree_texts.treetext_tree_id
			AND humo_tree_texts.treetext_language='".$Taalkeuze."'
			WHERE tree_prefix='".veilig($tree_prefix)."'";
		@$datasql = mysql_query($dataqry,$db);
		@$dataDb=mysql_fetch_object($datasql);

		// *** If no name is given for this language, try to find another name ***
		$treetext_name=$language["main_tree_no_name"];
		if (isset($dataDb->treetext_name)){ 
			$treetext_name=$dataDb->treetext_name;
		}
		else{
		//if (!$dataDb->treetext_name){
			$data2qry = "SELECT * FROM humo_trees LEFT JOIN humo_tree_texts
				ON humo_trees.tree_id=humo_tree_texts.treetext_tree_id
				AND treetext_name LIKE '_%'
				WHERE tree_prefix='".veilig($tree_prefix)."'";
			@$data2sql = mysql_query($data2qry,$db);
			@$data2Db=mysql_fetch_object($data2sql);
			if (isset($data2Db->treetext_name)){ $treetext_name=$data2Db->treetext_name; }
		}
		return $treetext_name;
	//}
}
?>
Return current item: HuMo-gen