Location: PHPKode > projects > RSS Link Adder > RSS_Reader/classes/RssLinkAdder.php
<?php
session_start();
include'DatabaseConnection.php';
/**
*to add link to the database
*
*/
class RssLinkAdder extends DatabaseConnection
{

		
		var $result;
		var $new_link;
		var $temp;
		var $select;
		var $duplicate_url;

/**
*inserting links to the database also checking for duplicate entry
*
*/
		function insertLink($sql)
		{	
			$this->databaseConnectivity();
			$this->new_link = mysql_query($sql)or die(mysql_error());	
			$this->affectedrows = mysql_affected_rows($this->con)or die(mysql_error());
			if($this->affectedrows==1)
			{
				$_SESSION['msg'] = "URL Added Sucessfully";
			}
			else
			{
				$_SESSION['msg'] = 'URL not added !';
			}
		}
	
/**
*selecting links from the database
*
*/      
		function selectLink($sql)
		{
			$this->databaseConnectivity();
			$this->result = mysql_query($sql);	
			$ret = array();
			while($ret[] = mysql_fetch_assoc($this->result));
			return $ret;
		}
}

?>
Return current item: RSS Link Adder