Question : Rss feed Data Comparision

I am trying to get the rss data and compare the title data from the rss feed to the Full_Name field in the mysql db.  
Can anyone please help me get this code working properly?
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
$ch = curl_init("http://buzzlog.buzz.yahoo.com/feeds/buzzsportm.xml");

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, 0);

$data = curl_exec($ch);
curl_close($ch);

$doc = new SimpleXmlElement($data, LIBXML_NOCDATA);

//print_r($doc);

if(isset($doc->channel))
{ parseRSS($doc);
}

if(isset($doc->entry))
{ parseAtom($doc);
}

function parseRSS($xml)
{
    echo "<strong>".$xml->channel->title."</strong>";
    $cnt = count($xml->channel->item);
    for($i=0; $i<$cnt; $i++)
    {
	$url 	= $xml->channel->item[$i]->link;
	
	$title 	= $xml->channel->item[$i]->title;
    $title = stripslashes($title);
    $title = strip_tags($title);
	$title = ereg_replace("[^A-Z a-z]", "", $title);
	
	$desc = $xml->channel->item[$i]->description;
	
	echo '<a href="'.$url.'"></br>'.$title.'</a> '.$desc.'</br>';
    }

// Connect to your MySQL database whatever way you like to here
include_once "connect_to_mysql.php";

$url = $_POST["link"]; 
$title = $_POST["title"];
$desc = $_POST["description"];

     // Database duplicate e-mail check setup for use below in the error handling if else conditionals
     $sql = mysql_query("SELECT Full_Name FROM stock_index WHERE Full_Name='$Full_Name'");
     $results = mysql_num_rows($sql); 
	 
	 $Current_Value = $row["Current_Value"];
	 
	 if ($title != $Full_Name) {
     print 'error';

	 }else{
	 print $Full_Name;

	 }
}
?>

Answer : Rss feed Data Comparision

oh and if you want you can get rid of the error stuff. These lines.

error_reporting(E_ALL);
ini_set('display_errors', '1');
function handleError($errno, $errstr, $errfile, $errline, array $errcontext) {
    die("##{$errstr}##");
}
set_error_handler('handleError');
Random Solutions  
 
programming4us programming4us