function getSingleResult($sql)
{
$response="";
$result = mysql_query($sql) or die("query failed: $sql");
if($line=mysql_fetch_array($result))
{
$response=$line[0];
}
return $response;
}
function executeUpdate($sql)
{
mysql_query($sql) or die("query failed: $sql".mysql_error());
}
if($_GET[ratelist])
{
$rateip=$REMOTE_ADDR;
$ratelist=$_GET[ratelist];
$id=$_GET[id];
$check="select * from yellow_rating where mediaid='$id' and ipaddress='$rateip'";
$response= getSingleResult($check);
if($response!="")
{
$msg="You have already rated this";
session_register('msg');
}
else
{
$sql1="insert into yellow_rating(ipaddress, rated,mediaid) values('$rateip','$rate','$id')" ;
executeUpdate($sql1);
$msg="Rating Submitted";
session_register('msg');
}
}
?>
Listing Details
|
echo $_SESSION[msg] ; session_unregister('msg')?> |
Reviews
|
|
|