|
Check if offer is already in database:
Put in your URL to search the database.
if($Srch_Url != '' && $Srch_Submit == "Search")
{
$Con_Name = '';
$count = 0;
preg_match('@^(?:http://)?([^/]+)@i', $Srch_Url, $matches);
$host = $matches[1];
$sql_Pertsrch = mysql_query("select * from `prizetune_website` where Expire>'".$today."' AND `URL`='".$Srch_Url."' group by `URL`");
$num_Pertsrch = mysql_num_rows($sql_Pertsrch);
$Pert_chk = mysql_fetch_array($sql_Pertsrch);
$sql_srch = mysql_query("select * from `prizetune_website` where Expire>'".$today."' AND (`URL` like '%".$Srch_Url."%' or `URL` like '%".$host."%') group by `URL`");
//$sql_srch = mysql_query("select * from `prizetune_website` where Expire>'".$today."' AND `URL` like '%".$Srch_Url."%' group by `URL`");
$num_result = mysql_num_rows($sql_srch);
if($num_result != 0)
{
while($row_srch = mysql_fetch_array($sql_srch))
{
$Arr_count[] = 0;
$result = $row_srch['URL'];
$Con_Id = $row_srch['Country'];
$sql_con = mysql_query("select * from `prizetune_country` where `countryId`='".$Con_Id."'");
if($row_con = mysql_fetch_array($sql_con))
{
$Con_Name = $row_con['name'];
}
if($Srch_Url == $row_srch['URL'])
{
?>
}
elseif($num_Pertsrch == 0 )
{
if($Arr_count[0] == $count)
{
?>
}
?>
}
else
{
if($Arr_count[0] == $count && $row_srch['URL'] != $Srch_Url)
{
?>
}
?>
}
$count++;
}
}
else
{
?>
}
}
?>
|
|