<?php
//Class for obtain some informations about a song

class Song
{
	private $id_song;
	
	/**
	 * @name GetSongName
	 * @return array
	 * @desc Return the title and subtitle of the song
	 */
	function GetSongName()
	{
		$r_res=mysql_query('SELECT title,subtitle FROM song_stats WHERE song_ID='.$this->id_song);
		return $a_data=mysql_fetch_assoc($r_res);
	}
	
	/**
	 * @name GetSongArtist
	 * @return string
	 * @desc Return the artist of the song
	 */
	function GetSongArtist()
	{
		$r_res=mysql_query('SELECT artist FROM song_stats WHERE song_ID='.$this->id_song);
		return $a_data=mysql_fetch_assoc($r_res);
	}
	
	/**
	 * @name GetSongPlayedNumber
	 * @return int
	 * @desc Return the artist of the song
	 */
	function GetSongPlayedNumber()
	{
		$r_res=mysql_query('SELECT played FROM song_stats WHERE song_ID='.$this->id_song);
		return $a_data=mysql_result($r_res,0,0);
	}
	
	/**
	 * @name SetSongID
	 * @param i_sid int
	 * @desc Set the Song_ID used by the class
	 */
	function SetSongID ($i_sid)
	{
		$this->id_song=$i_sid;
	}
}
?>