<?php
include'DatabaseConnection.php';
/**
* to update change in the url into the database
*
*/
class UpdateUrl extends DatabaseConnection
{
/**
* Select url form the database
*
*/
function executeSelect($sel)
{
$this->databaseConnectivity();
$this->result = mysql_query($sel)or die(mysql_error());
$ret = array();
while($ret[] = mysql_fetch_assoc($this->result));
return $ret;
}
/**
* Updata the changes in the url into the database
*
*/
function executeUpdate($upd)
{
$this->databaseConnectivity();
mysql_query($upd,$this->con)or die(mysql_error());
$this->recordsaffected=mysql_affected_rows($this->con);
if(recordsaffected)
{
$_SESSION['updated'] = "The Link"." "."<u>".$_POST['updatedname']."</u>"." has been updated";
}
else
{
$_SESSION['updated'] = "your link is not updated try again!";
}
}
/**
* to delete the url from the database
*
*/
function executeDelete($del)
{
$this->databaseConnectivity();
$temp = "SELECT link_name FROM rsslinks_table WHERE link_id =".$_GET['link_id'];
$result = mysql_query($temp);
$fetch_name = mysql_fetch_row($result);
mysql_query($del,$this->con) or die(mysql_error());
$this->recordsaffected=mysql_affected_rows($this->con);
if(recordsaffected)
{
$_SESSION['deleted'] = "The Link"." "."<u>".$fetch_name[0]."</u>"." "."has been Deleted";
}
else
{
$_SESSION['deleted'] = "unable to delete !";
}
}
}
?>