DisplayModul class

<?php
class SitecounterService 
{
	public function getUniqueData() 
	{
		$link = mysql_connect('localhost', 'root', 'root');
		if(!$link)
		{
			$message = "Could not connect!";
		}
		$link = mysql_select_db('test');
		if(!$link)
		{
			$message = "Could not connect to database!";
		}
		$query = "SELECT `unique` FROM `sitecounter`";
		$result = mysql_query($query);
		$row = mysql_fetch_array($result);
		$message = $row['unique'];
		return $message;
	}

	public function addUniqueData()
	{
		$link = mysql_connect('localhost', 'root', 'root');
		if(!$link)
		{
			$message = "Could not connect!";
		}
		$link = mysql_select_db('test');
		if(!$link)
		{
			$message = "Could not connect to database!";
		}
		$query = "SELECT `unique` FROM `sitecounter`";
		$result = mysql_query($query);
		$row = mysql_fetch_array($result);
		$counts = $row['unique'];
		$newcount = $counts + 1;
		$query = "UPDATE `sitecounter` SET `unique` = '$newcount'";
		$result = mysql_query($query);
		if(!$result)
		{
			$message = "Could not add data!";
		}
		else
    	{
			$message = $row['unique'];
		}
		return $message;
	}

	public function addAllData()
	{
  		$link = mysql_connect('localhost', 'root', 'root');
		if(!$link)
		{
			$message = "Could not connect!";
		}
		$link = mysql_select_db('test');
		if(!$link)
		{
			$message = "Could not connect to database!";
		}
   		$query = "SELECT `allcounts` FROM `sitecounter`";
		$result = mysql_query($query);
		$row = mysql_fetch_array($result);
   		
		$counts = $row['allcounts'];
		$newcount = $counts + 1;
		$query = "UPDATE `sitecounter` SET `allcounts` = '$newcount'";
		$result = mysql_query($query);
		if(!$result)
		{
			$message = "Could not add data!";
		}
		else
		{
			$message = $row['allcounts'];
		}
		return $message;
	}
}
?>